From 7daf034fd94a8a07f9cbb5d070a085de69d184fd Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 21 Feb 2020 13:57:25 +0000 Subject: Async delayed hello world, first draft Signed-off-by: Daniel Silverstone --- cgi-bin/and-then-js-async-cb-adds-timeout.js | 11 +++++++++++ cgi-bin/and-then-js.cgi | 24 ++++++++++++++++++++++++ html/async-delayed-hello-world.html | 9 +++++++++ html/hello-world.js | 3 +++ 4 files changed, 47 insertions(+) create mode 100644 cgi-bin/and-then-js-async-cb-adds-timeout.js create mode 100755 cgi-bin/and-then-js.cgi create mode 100644 html/async-delayed-hello-world.html create mode 100644 html/hello-world.js 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 + + +

Check the console for a hello world log

+ + diff --git a/html/hello-world.js b/html/hello-world.js new file mode 100644 index 0000000..03a10db --- /dev/null +++ b/html/hello-world.js @@ -0,0 +1,3 @@ +/* Hello World */ + +console.log("Hello World") -- cgit v1.2.3