-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
78 lines (67 loc) · 2.14 KB
/
index.html
File metadata and controls
78 lines (67 loc) · 2.14 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h3 id="add">123</h3>
<script src="ajax.js"></script>
<script>
Function.prototype.xtCall = function(thisArg) {
const fn = this
thisArg = (thisArg !== null || thisArg !== undefined) ? Object(thisArg) : window
// 获取需要执行的函数
thisArg.fn = fn
thisArg.fn()
delete thisArg.fn
// const fn = this
// fn()
}
function foo() {
console.log(222, this)
}
foo.xtCall({name: 'kofi'})
// var a = {aaa: '123'}
// var b = {aaa: '1', bbb: 'aaaa'}
// console.log({...a, ...b})
// const arr = [1, 5, 10, 12, 15, 18]
// for (let i of arr) {
// if (i > 10) {
// break
// }
// console.log(i)
// }
// let a = 46;
// let b = 10;
// [a, b] = [b, a];
// console.log(b)
const arr = [0, 1, 2, 3]
const arr1 = [...new Set(arr)]
arr[0] = 1
console.log(arr)
console.log(arr1)
//基本的使用实例
// ajax({
// url:"https://gaiatools-483118822.ap-northeast-1.elb.amazonaws.com/api/csv/data/device",
// type:'get',
// data:{
// name: '123'
// },
// dataType:'json',
// timeout:10000,
// contentType:"application/json",
// success:function(data){
// document.getElementById('add').innerHTML = JSON.parse(data).time;
// //服务器返回响应,根据响应结果,分析是否登录成功
// },
// //异常处理
// error:function(e){
// console.log(e);
// }
// })
</script>
</body>
</html>