-
Notifications
You must be signed in to change notification settings - Fork 0
/
time.html
90 lines (87 loc) · 3.13 KB
/
time.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
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
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> 卸载事件 </title>
<script type="text/javascript">
function delhandler() {
alert(1);
}
function getQueryStringArgs() {
var qs = (location.search.length > 0 ? location.search.substring(1) : ''),
args = {},
items = qs.length ? qs.split('&') : [],
item = null,
name = null,
value = null,
i = 0,
len = items.length;
for (i = 0; i < len; i++) {
item = items[i].split('=');
name = decodeURIComponent(item[0]);
value = decodeURIComponent(item[1]);
if (name.length) {
args[name] = value;
}
}
return args;
}
var i = 0;
console.log(i);
i++;
let cachedScript = {};
function loadScript(src, callback, component, nocache) {
let script = cachedScript[src];
console.log('script is',script);
if (nocache && script) {
script.parentNode.removeChild(script);
script = null;
}
if (script) {
callback && callback();
return new Promise((resolve) => resolve());
} else {
script = document.createElement('script');
script.src = src;
document.head.appendChild(script);
return new Promise((resolve, reject) => {
script.addEventListener('load', function () {
cachedScript[src] = script;
callback && callback();
resolve();
// if (!isUnMounted(component)) {
// callback && callback();
// resolve();
// }
}, false);
script.addEventListener('error', function () {
script.parentNode.removeChild(script);
reject();
});
})
}
}
loadScript('//dl.ntalker.com/js/xn6/ntkfstat.js?siteid=kf_9552');
// console.log('args ', JSON.stringify(getQueryStringArgs()));
</script>
</head>
<body>
欢迎学习JavaScript。
<a href="#" id="editBtn">编辑</a>
<a href="#" id="delBtn">删除</a>
<span>12344</span>
<script language="javascript" type="text/javascript">
window.NTKF_PARAM = {
siteid: "kf_9552", //企业ID,为固定值,必填
settingid: "kf_9552_1492150519088", //接待组ID,为固定值,必填
uid: "12323", //用户ID,未登录可以为空,但不能给null,uid赋予的值显示到小能客户端上
uname: "[email protected]", //用户名,未登录可以为空,但不能给null,uname赋予的值显示到小能客户端上
isvip: "0", //是否为vip用户,0代表非会员,1代表会员,取值显示到小能客户端上
userlevel: "1", //网站自定义会员级别,0-N,可根据选择判断,取值显示到小能客户端上
erpparam: "abc" //erpparam为erp功能的扩展字段,可选,购买erp功能后用于erp功能集成
}
</script>
<!--基础脚本加载 -->
<script type="text/javascript" src="http://dl.ntalker.com/js/xn6/ntkfstat.js?siteid=kf_9552" charset="utf-8"></script>
</body>
</html>