Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Perl and Browser compatibility

by pankaj_it09 (Scribe)
on Feb 14, 2007 at 07:37 UTC ( [id://599873] : perlquestion . print w/replies, xml ) Need Help??

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


Is it something that Perl CGI provides to counter browser incompability ?

I am working on a Live Website.
It works fine with Mozilla Firefox.
But some pages don't open in Internet Explorer.
For eg:- when I open a page(which is not opening in IE) it loops for sometime and then a message comes that IE cannot open the site . Operation Aborted.

Another case is that when I click on a link to perform certain operation it doesn't work. The error message is that Object missing in filename.cgi(the file in which Perl code is present).
This happens only for some pages and links and only in IE. Can CSS create a problem ?

Please tell me what to do.

Replies are listed 'Best First'.
Re: Perl and Browser compatibility
by davorg (Chancellor) on Feb 14, 2007 at 08:30 UTC

    Perl knows nothing about browsers. And browsers know nothing about Perl.

    Browsers simply interpret the HTML and/or Javascript that your Perl program creates. If the HTML or Javascript doesn't work in every browser then you will have a problem.

    The solution is to look at your HTML and Javascript and work out how to achieve the effects you want in a cross-browser manner (sticking to W3C standards would be a good start). You then write a Perl program that creates that HTML and Javascript.

      Well, Internet Explorer might know something about Perl ;)

      (This has nothing at all to do with CGI though and doesn't have any bearing on the OP's question.)

      Check your JavaScript for errors. W3C validator doesn't check errors in your JavaScript code. It's validate only markup (HTML+CSS).
      Perl knows nothing about browsers. And browsers know nothing about Perl.

      While this is true, it misses the point. Code written in Perl can most definitely know something about browsers.

      While I very much doubt it has anything to do with the OP's question, does in fact check the user agent to work around a bug in IE3.01 on macs.

      "My two cents aren't worth a dime.";
Re: Perl and Browser compability
by pajout (Curate) on Feb 14, 2007 at 10:48 UTC
    With respect of davorg's advice, I recommend The W3C Markup Validation Service.

    But don't forget that browsers, specially MSIE's, don't fit W3C recommendations/specifications fully.

      I validated using the above link.

      Its fine.

      "Passed validation"

        Here's what's wrong then :) IE is notoriously known for disrespecting standards. Unfortunately, like many others, you'll have to "code for IE". Sometimes both coding for standards and IE is close to impossible, unfortunately.
        Can CSS be a problem ?
Re: Perl and Browser compability
by varian (Chaplain) on Feb 14, 2007 at 08:54 UTC
    CGI offers you much flexibility but it's not a fix for the browser incompatibility problems. My experience is that Mozilla based browsers are more forgiving for HTML syntax errors than IE. (e.g. if you failed to include a closing markup </div> or </table>). So if my Perl code looks okay yet breaks with IE clients my first reaction is to check again the hierarchy and syntax of the generated HTML.
Re: Perl and Browser compatibility
by pankaj_it09 (Scribe) on Feb 15, 2007 at 08:34 UTC
    Hey I have solved the first problem.

    It was the Embedded CSS which was creating the problem.

    I removed the CSS and put it in an External CSS.

    Now I have to solve the link problem.

Re: Perl and Browser compatibility
by dpavlin (Friar) on Feb 15, 2007 at 16:22 UTC
    "Operation aborted" message on Internet Explorer is usually caused by modifing elements which are not yet drawn completely (common when using inline JavaScript, and from your experience it seems to apply to CSS also).

    One solution is to use onLoad or even better DOM.Ready from JSAN.

Re: Perl and Browser compatibility
by Moron (Curate) on Feb 15, 2007 at 15:03 UTC
    The HTTP::BrowserDetect module provides methods for detecting the os and browser. The distinction could at least be used to redirect or inline branch users of technically unsupportable platforms (whatever they might be ;)) to provide them with a reduced-service version of your site.

    ;)Although, in practice, in the corporate Windows environment I would be also tempted to let the problem happen and cry non-responsibility for Microsoft problems ... "I can't help it if the corporate standard is to choose a browser that has faults I can't support ;)"


    Free your mind

Re: Perl and Browser compatibility
by Sagacity (Monk) on Feb 15, 2007 at 16:30 UTC

    Your first step (with respect to the reply by moron) is to announce that you have achieved success and completion with the project using the Firefox browser. All those who wish to use this new interface should use this browser until further coding (and additional funding) can be implemented to accommodate non-compliant browsers. Then it's time to start hacking as davorg and the others have suggested.

    Using CSS may also bring rise to problems in the future using IE. MS seems to have some version problems with that, even though they have work-arounds, it will become an ongoing task to maintain the compliance of CSS and IE browsers.

Re: Perl and Browser compatibility
by DrHyde (Prior) on Feb 15, 2007 at 10:15 UTC
    Well *I* just ignore IE. I find that this improves my mental health.
      I am in corporate world so I can't ignore IE . :-)
        So am I, and I can. That's partly because we don't try to do anything fancy, but also because our HTML is written to comply with standards, and IE's compatibility these days is a *lot* better than it used to be. People who tell you that IE blithely ignores standards are, to a certain extent, FUDding.
Re: Perl and Browser compatibility
by mr_mischief (Monsignor) on Feb 18, 2007 at 18:32 UTC
    I suggest installing the Firebug extension for Firefox. It'll show you errors in your Javascript and let you debug it. That's almost certainly where your issues lie.

    Christopher E. Stith
Re: Perl and Browser compability
by Anonymous Monk on Feb 15, 2007 at 04:28 UTC
    I can't see what Davorg has written.