您应该将“$.get(url, handlerFunction)”放入一个 promise 中,因为 await 期望返回一个 Promise,因此您可以像下面这样编写您的代码而不是您的代码。async function jget(url){ // Note: Below variable will hold the value of the resolved promise let response = await fetchingData(url);}function fetchingData(url) { return new Promise((resolve, reject) => { $.get(url, html => { resolve(html) })})}