-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.html
44 lines (40 loc) · 1.3 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>test</title>
<meta name="description" content="Testing Scripts locally" />
<meta name="author" content="Bergi" />
<script type="text/javascript" id="shim">
if (!this.setImmediate)
this.setImmediate = function setImmediate(fn) { return setTimeout(fn, 0); };
if (!this.clearImmediate)
this.clearImmediate = clearTimeout;
if (!Object.setPrototypeOf && Object.prototype.hasOwnProperty("__proto__"))
Object.setPrototypeOf = function setPrototypeOf(o, p) { o.__proto__ = p; return o; };
</script>
<script src="js/promise.umd.js"></script>
</head>
<body>
<h1>Fire up the console and go ahead!</h1>
<form id="loader">
<p>Also load the following script:</p>
<label>Filename: <input type="text" name="name" value="" /></label>
<button type="submit">Load!</button>
</form>
<script type="text/javascript">
(function() {
"use strict";
var l = document.getElementById("loader"),
b = l.lastElementChild;
l.onsubmit = function(e) {
e.preventDefault();
var s = document.head.appendChild(document.createElement('script'));
s.src = l.elements.name.value+'.js';
s.onload = function() { b.textContent = "Reload!"; };
b.textContent = "…";
};
})();
</script>
</body>
</html>