forked from zynga/atom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
64 lines (54 loc) · 1.13 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
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<title>atom.js tests</title>
<script type="text/javascript" src="atom.js"></script>
<script type="text/javascript">
var queue = [];
function onReady(callback) {
if (document.readyState === 'complete') {
callback();
} else {
queue.push(callback);
}
}
function purgeQueue() {
while (queue.length) {
queue.shift()();
}
}
if (window.addEventListener) {
window.addEventListener('load', purgeQueue);
} else {
window.attachEvent('onload', purgeQueue);
}
function addText(msg) {
onReady(function () {
document.getElementById('console')
.appendChild(document.createTextNode(msg + '\n'));
});
}
function logObj(obj) {
for (var p in obj) {
if (obj.hasOwnProperty(p)) {
addText(p + ': ' + obj[p]);
}
}
}
function logger(obj) {
if (typeof console !== 'undefined' && console.log) {
console.log(obj);
}
if (obj && typeof obj === 'object') {
logObj(obj);
} else {
addText(obj + '');
}
}
</script>
<script type="text/javascript" src="test.js"></script>
</head>
<body>
<pre id="console"></pre>
</body>
</html>