forked from wilkinson/wilkinson.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.js
28 lines (23 loc) · 885 Bytes
/
header.js
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
//- JavaScript source code
//- header.js ~~
// This defines the libraries, etc. needed to run the program in 'main.js'.
// ~~ SRW, 29 Oct 2010
if (this.window === undefined) {
throw "This demonstration has not been mplemented for headless contexts.";
}
var load = function () {
var args = Array.prototype.slice.call(arguments), i, s;
for (i = 0; i < args.length; i += 1) {
s = document.createElement('script');
s.src = args[i];
document.body.appendChild(s);
}
},
print = function () {
var args = Array.prototype.slice.call(arguments),
sink = document.getElementById('sink');
for (i = 0; i < args.length; i += 1) {
sink.innerHTML += '<div>' + args[i] + '</div>';
}
};
//- vim:set syntax=javascript: