Compare commits

..

2 Commits

Author SHA1 Message Date
309cd1125c 获取元素改用jquery的写法 2024-10-10 12:10:59 +08:00
0fca78f3bc fix 2024-10-10 11:08:59 +08:00
2 changed files with 10 additions and 9 deletions

View File

@ -83,6 +83,7 @@ doSomethingAsync((result1) => {
##### 3.3.1.2 Promise对象
[Promise 10分钟理论+实操](https://www.bilibili.com/video/BV1yu4y1H7ET/?spm_id_from=333.337.search-card.all.click&vd_source=fb252f6c305362a2870fb7388465df99)
[最好理解的Promise教程](https://www.bilibili.com/video/BV1454y1R7vj?p=1)
[异步编程: 一次性搞懂 Promise, async, await (#js #javascript)](https://www.bilibili.com/video/BV1WP4y187Tu/?spm_id_from=333.337.search-card.all.click&vd_source=fb252f6c305362a2870fb7388465df99)
@ -317,8 +318,8 @@ async function example() {
console.log('Data received:', data);
console.log('Text Status:', textStatus);
console.log('jqXHR:', jqXHR);
document.getElementById("title").innerHTML = data.title;
document.getElementById("content").innerHTML = data.body;
$("#title").html(data.title);
$("#content").html(data.body);
}).fail(function(jqXHR, textStatus, errorThrown) {
console.error('Request failed:', textStatus, errorThrown);
});
@ -331,8 +332,8 @@ async function example() {
console.log('Data received:', data);
console.log('Text Status:', textStatus);
console.log('jqXHR:', jqXHR);
document.getElementById("title2").innerHTML = data.title;
document.getElementById("content2").innerHTML = data.body;
$("#title2").html(data.title);
$("#content2").html(data.body);
},
error: function(jqXHR, textStatus, errorThrown) {
console.error('Request failed:', textStatus, errorThrown);

View File

@ -23,8 +23,8 @@
console.log('Data received:', data);
console.log('Text Status:', textStatus);
console.log('jqXHR:', jqXHR);
document.getElementById("title").innerHTML = data.title;
document.getElementById("content").innerHTML = data.body;
$("#title").html(data.title);
$("#content").html(data.body);
}).fail(function(jqXHR, textStatus, errorThrown) {
console.error('Request failed:', textStatus, errorThrown);
});
@ -37,8 +37,8 @@
console.log('Data received:', data);
console.log('Text Status:', textStatus);
console.log('jqXHR:', jqXHR);
document.getElementById("title2").innerHTML = data.title;
document.getElementById("content2").innerHTML = data.body;
$("#title2").html(data.title);
$("#content2").html(data.body);
},
error: function(jqXHR, textStatus, errorThrown) {
console.error('Request failed:', textStatus, errorThrown);