-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
48 lines (41 loc) · 901 Bytes
/
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge, chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>test</title>
</head>
<body>
<h1>请打开控制台查看</h1>
<script src="pageMsgCollection.js"></script>
<script>
// 初始化
pageMsgCollection.init({
'url': 'putMsg.php',
'pageInfo': {
'form': 'test page',
}
});
// 输出库的相关信息
let version = pageMsgCollection.getVersion();
console.log('version:' + version);
let _default = pageMsgCollection.getDefault();
console.log(_default);
// 发送自定义消息
pageMsgCollection.sendInfo('this is a msg');
// 测试
function fun() {
fun2();
}
// 这个异常不会上报
try {
fun();
} catch (e) {
console.error(e);
}
// 这个异常会上报
fun();
</script>
</body>
</html>