Bman70 has asked for the wisdom of the Perl Monks concerning the following question:

I have a CGI.pm generated web page. The html is printed at the end of the script, from a variable using 'qq{' to escape all the html. I do this a lot, but in this instance the page has large letters "Loading" at the very bottom. It's unusual because significant googling turned up nothing.. either this is something so simple everyone should know it, or very obscure. My script ends with 'exit 0' so it doesn't seem that it would be hung up somewhere right? Screenshot: https://i.imgur.com/9KtkGwL.png

It looks like CGI.pm itself is generating the large text, since it seems to be outside the html code.
p.s. I am printing a CGI.pm header.
The $html variable also has a doctype and html declaration, but I took out the doctype and nothing changed.
I'm using strict / warnings. No errors show up in my nginx logs.

Replies are listed 'Best First'.
Re: cgi web page always 'Loading'
by LanX (Saint) on Feb 02, 2021 at 02:35 UTC
    I can only give you a general debugging advice:

    First thing for me would be to find out if it's a Perl or an nginx config problem.

    I'd suggest running the cgi manually from the command-line and to check the output - probably also piped to a file and opened in a browser too.

    If it looks OK, you'll have to fix nginx.

    If not, than you can narrow the problem by shortening the script.

    HTH. :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Re: cgi web page always 'Loading'
by Polyglot (Chaplain) on Feb 02, 2021 at 02:42 UTC

    You're not likely to get quality answers without showing us some code. Have you looked at the web console of your browser to see what errors it reports? What JavaScript functions are you running...any that would show some text like that while it thinks it's waiting for an image to load or something?

    Have you done file searches to verify that you do not have the word "Loading" somewhere in any of your code (Perl, JavaScript, etc.)?

    Blessings,

    ~Polyglot~

Re: cgi web page always 'Loading'
by Bman70 (Acolyte) on Feb 02, 2021 at 02:34 UTC
    Ah well, no sooner asked... it's apparently related to some jquery links in my document head.
    Removing this made it go away:
    <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5. +min.js">
    Still not sure why there's no error, but at least it's not 'Loading.' Not sure if I can delete my post but mods feel free since it might not be a perl issue per se.
      > Still not sure why there's no error,

      because it's executed on the client side.

      make sure that JS is enabled and check the JS-Console for errors (F12 in the browser)

      > Not sure if I can delete my post

      No, but you can edit and mark the title with (Solved)

      > it might not be a perl issue per se.

      yeah :)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

A reply falls below the community's threshold of quality. You may see it by logging in.