Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Perl Website Fails on tablet

by tonyb48 (Novice)
on Mar 20, 2012 at 02:16 UTC ( #960507=perlquestion: print w/replies, xml ) Need Help??
tonyb48 has asked for the wisdom of the Perl Monks concerning the following question:

I have a website written in Perl that works fine on PCs and Macs in any browser I have tried. cfhs69.com. It also works on my Android phone. It does not display on my Android tablet in the native browser, in Dolphin, nor in Firefox. It also does not display on an iPad. Can you suggest where I might start my debugging? There are no error messages in my error log.

Replies are listed 'Best First'.
Re: Perl Website Fails on tablet
by tangent (Priest) on Mar 20, 2012 at 02:34 UTC
    Not sure if it will make a difference but I notice on your page you have:
    </head> <body> <!--[if IE]> <link rel='stylesheet' type='text/css' href='http://www.cfhs69.com/css +/ie.css'> <![endif--]>
    Link tags should be within the <head> and the comment is not being closed properly, should be:
    <!--[if IE]> <link rel='stylesheet' type='text/css' href='http://www.cfhs69.com/css +/ie.css'> <![endif]--> </head> <body>

      It is indeed the improperly closed comment. Whether that comment appears in the <head> or <body> in this case does not actually matter one whit. Obviously <link> elements are supposed to be in the <head>, but in practice browsers do not care about them being in the <body>.

      The fact that this one does not end with "-->" though is the problem. Effectively, the comment does not end at all!

      The original asker claims that it "works fine on PCs and Macs in any browser [he has] tried". I'd suggest that he's probably not tried very many recent ones. Some older browsers will happen to have error correction algorithms built-in that might be able to cope with this page. However, newer ones are all converging on the "One True" HTML parsing algorithm that appears in the HTML5 specification, which treats the page in question as basically one big comment, starting on line 12 and ending on line 105.

      Using lwp-request (part of LWP) and html5debug (part of HTML::HTML5::Parser)...

      [tai@miranda (pts/3) ~]$ lwp-request http://www.cfhs69.com/cgi-bin/alumni001A.pl | html5debug --output=err
      sniffing:chardet [complicance: INFO; line: 1; column: 1]
      not HTML5 [complicance: MUST; line: 4; column: 0]
      charset label:matching [complicance: INFO; line: 9; column: 0]
      unclosed comment [complicance: MUST; line: 105; column: 7]
      
      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

        Lord I am not worthy

        Thank you very much for investing this much effort on solving my problem. I made the change and now it works (as you knew it would)

        I will investigate LWP and html5debug and add them to my library of debug tools

      Thank you for taking your time to work on my problem.

      That appears to be exactly the issue. I swapped "]" with "--". It seems like some browsers tolerate this error, while others treated all my content like a comment! I made the edit and now it works in my tablet.

      If we all had a second pair of eyes, maybe we would not miss these things....

Re: Perl Website Fails on tablet
by bitingduck (Chaplain) on Mar 20, 2012 at 03:11 UTC

    For what it's worth, it doesn't display on any browser on my mac. I get a plain black page with no visible content. If I look at the html, I get a bunch of typical looking html but it just renders black. I haven't made any attempt to try to debug the html.

    The browsers I've used are:

  • Firefox 10.0.2
  • Safari 5.1.2
  • Chrome 17.0.963.78
  • I'm on a Mac running 10.6.8 on an old Core Duo

    correction: I restarted Chrome (at its request) and reloaded the page. It gave me a quick "Class of 1969 Alumni..." flash, then went to black.

    Probably start by seeing if you can make a static page that works from the html that you're generating, and figure out where that's going wrong, first.

Re: Perl Website Fails on tablet
by GrandFather (Sage) on Mar 20, 2012 at 02:39 UTC

    "does not display" is not a lot to go on. A LWP::Simple get on http://cfhs69.com/ and on http://www.cfhs69.com/cgi-bin/alumni001A.pl which it redirects to both give reasonable looking HTML. Maybe there is something server side that is going pear shaped due to an Android tablet difference, but you're going to have to debug that with appropriate logging on a server.

    If you are using Apache you may find something of interest in access.log.

    True laziness is hard work
Re: Perl Website Fails on tablet
by Anonymous Monk on Mar 20, 2012 at 02:46 UTC

    Can you suggest where I might start my debugging? There are no error messages in my error log.

    You say some browsers are not displaying what you want? Start with the browsers (page info, error console, view source .... ) then move on to http://validator.w3.org/unicorn/

Re: Perl Website Fails on tablet
by mendeepak (Scribe) on Mar 20, 2012 at 07:06 UTC

    I checked your site in W3C Validator but didn't get any valid errors just one unclosed tag error, just check on that some times small errors can cause these. here is the link to your errors Errors

      Thanks very much for investing your time fixing my problem.

      1. I fixed the errors and now it checks out
      2. I put the W3C Validator in my bookmarks and will use it henceforth (I know this should have been automatic for me, but I am still learning)
      3. Interestingly, the W3C Validator missed the real problem, noted in the replies above yours. Because I transposed a "]" and a "--" a comment tag was not closed. Some browsers tolerated this error; others treated all my content as a huge comment!

        Good to know that your problem has been fixed...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://960507]
Approved by GrandFather
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2018-02-19 00:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (257 votes). Check out past polls.

    Notices?