update
This commit is contained in:
@@ -10,3 +10,17 @@ function loadTracks() {
|
||||
// 1. 调用 loadTracks()
|
||||
// 2. 成功时更新状态和输出内容
|
||||
// 3. 失败时更新状态
|
||||
async function load() {
|
||||
const status = document.getElementById("status")
|
||||
status.textContent = "加载中"
|
||||
try {
|
||||
const a = await loadTracks()
|
||||
status.textContent = "加载成功"
|
||||
const output = document.getElementById("output")
|
||||
output.textContent = a
|
||||
} catch (error) {
|
||||
status.textContent = "加载失败"
|
||||
}
|
||||
|
||||
}
|
||||
load()
|
||||
Reference in New Issue
Block a user