因此,我的代码的if / else塑像部分出现错误,该错误返回错误:Uncaught TypeError:无法读取未定义的属性'success'。有任何想法吗?
function responseReceivedHandler(data) {
/* Successful request:
{
"success": true,
"todos": [ '...', '...', ... ]
}
Unsuccessful request:
{
"success": false,
"error": "..."
} */
/* Your solution goes here */
if (this.response.success === true)
{
console.log(this.response.todos);
}
else {
console.log(this.response.error);
}
}
$.get("https://wp.zybooks.com/todos.php", { day: "Monday" },
responseReceivedHandler, "json");