-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
53 lines (44 loc) · 1.22 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<div id="d">
</div>
<script>
// thirdpartyfunction((data,data1)=>{
// console.log(data);
// console.log(data1)
// });
// function fn1(data,data1){
// console.log(data);
// console.log(data1)
// }
// (function thirdpartyfunction(arg){
// var a = 10;
// var b = 11;
// arg(a,b);
// })(fn1);
// var d = document.getElementById('d');
// updatedom();
// async function updatedom(){
// var a = await callapi();
// d.innerHTML = a;
// }
function callapi(){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = async function() {
if (this.readyState == 4 && this.status == 200) {
var a = xhttp.responseText;
res(a);
}
};
xhttp.open("GET", "https://jsonplaceholder.typicode.com/todos/1", true);
xhttp.send();
}
</script>
</body>
</html>