summaryrefslogtreecommitdiff
path: root/cgi-bin/and-then-js-async-cb-adds-timeout.js
diff options
context:
space:
mode:
Diffstat (limited to 'cgi-bin/and-then-js-async-cb-adds-timeout.js')
-rw-r--r--cgi-bin/and-then-js-async-cb-adds-timeout.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/cgi-bin/and-then-js-async-cb-adds-timeout.js b/cgi-bin/and-then-js-async-cb-adds-timeout.js
new file mode 100644
index 0000000..b53678b
--- /dev/null
+++ b/cgi-bin/and-then-js-async-cb-adds-timeout.js
@@ -0,0 +1,11 @@
+/* JS returned by and-then-js.cgi
+ * this is to be loaded as an async script
+ */
+
+/* After one second */
+setTimeout(1000, function() {
+ /* Add a <script> tag */
+ var script = document.createElement("SCRIPT");
+ script.src = "https://test.netsurf-browser.org/hello-world.js";
+ document.body.appendChild(script);
+});