OK I'm back online. :)

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 &lt;script&gt; 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>
It shows the alert box from JS but the Perl execution blocks the tab till I get a "Tab crashed" message (in German) after a minute or so.

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


In reply to Re^5: webperl: fetching data over the web by LanX
in thread webperl: fetching data over the web by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.