in reply to Re^4: webperl: fetching data over the web
in thread webperl: fetching data over the web
I created the following page called weblib_demo.html inside the deflated zip-dir (webperl_prebuilt_v0.07-beta.zip) from your webpage:
<!doctype html> <html lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>WebPerl <script> Demos</title> <script type="text/javascript"> function xfetch(url) { var req = new XMLHttpRequest(); req.open('GET', 'http://localhost:5000/emperl.js', false); req.send(null); if(req.status == 200) { return req.responseText; } else { return "FAILED"; } } alert(xfetch('http://localhost:5000/emperl.js')); </script> <script src="webperl.js"></script> <!-- Please see the documentation at http://webperl.zero-g.net/using.h +tml --> <script type="text/perl"> use warnings; use strict; use WebPerl qw/js/; print js('window.xfetch("http://localhost:5000/emperl.js")'); </script> <!-- Optional STDOUT/STDERR text area (if you don't use this, output g +oes to Javascript console) --> <script> window.addEventListener("load", function () { document.getElementById('output') .appendChild( Perl.makeOutputTextarea() ); }); </script> </head> <body> <p>This is a demo of <a href="http://webperl.zero-g.net" target="_blan +k">WebPerl</a>!</p> <div id="output"></div> <div id="buttons"> <button id="my_button">Testing!</button> </div> </body> </html>
Reproducible in FF and chrome.
I'm suspecting it has to do with error handling of the deprecation warning.
I tried to copy the democode directory directly from github, but calling demo.html creates an endless loop of "Perl initializing" and "ended" messages.
I suppose the webperl versions are not compatible and I need to clone the whole github rep.
That's the messages I get on the console
127.0.0.1 - - [08/Nov/2018:18:33:51 +0100] "GET /webperl.js HTTP/1.1" +200 13452 "http://localhost:5000/democode/perlrunner.html" "Mozilla/5 +.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko/20100101 Firefox/61.0" 127.0.0.1 - - [08/Nov/2018:18:33:51 +0100] "GET /emperl.js HTTP/1.1" 2 +00 404633 "http://localhost:5000/democode/perlrunner.html" "Mozilla/5 +.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko/20100101 Firefox/61.0" 127.0.0.1 - - [08/Nov/2018:18:33:51 +0100] "GET /emperl.data HTTP/1.1" + 200 11957600 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:61.0) Geck +o/20100101 Firefox/61.0" 127.0.0.1 - - [08/Nov/2018:18:33:51 +0100] "GET /emperl.wasm HTTP/1.1" + 200 3743906 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko +/20100101 Firefox/61.0" 127.0.0.1 - - [08/Nov/2018:18:33:51 +0100] "GET /emperl.wasm HTTP/1.1" + 200 3743906 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko +/20100101 Firefox/61.0" 127.0.0.1 - - [08/Nov/2018:18:33:51 +0100] "GET /democode/perlrunner.h +tml HTTP/1.1" 200 6168 "http://localhost:5000/democode/demo.html" "Mo +zilla/5.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko/20100101 Firefox/61 +.0" 127.0.0.1 - - [08/Nov/2018:18:33:52 +0100] "GET /webperl.js HTTP/1.1" +200 13452 "http://localhost:5000/democode/perlrunner.html" "Mozilla/5 +.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko/20100101 Firefox/61.0" 127.0.0.1 - - [08/Nov/2018:18:33:52 +0100] "GET /emperl.js HTTP/1.1" 2 +00 404633 "http://localhost:5000/democode/perlrunner.html" "Mozilla/5 +.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko/20100101 Firefox/61.0" 127.0.0.1 - - [08/Nov/2018:18:33:52 +0100] "GET /emperl.data HTTP/1.1" + 200 11957600 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:61.0) Geck +o/20100101 Firefox/61.0" 127.0.0.1 - - [08/Nov/2018:18:33:52 +0100] "GET /emperl.wasm HTTP/1.1" + 200 3743906 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko +/20100101 Firefox/61.0" Terminating on signal SIGINT(2)
I think creating a new zip including the "democode" stuff would be helpful for causal tests.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: webperl: fetching data over the web
by haukex (Archbishop) on Nov 08, 2018 at 18:06 UTC | |
by LanX (Saint) on Nov 08, 2018 at 18:14 UTC | |
by haukex (Archbishop) on Nov 08, 2018 at 18:20 UTC | |
by LanX (Saint) on Nov 08, 2018 at 18:21 UTC | |
by haukex (Archbishop) on Nov 08, 2018 at 18:36 UTC | |
by LanX (Saint) on Nov 10, 2018 at 16:54 UTC | |
by haukex (Archbishop) on Nov 11, 2018 at 08:53 UTC |