Results 1 to 4 of 4

Thread: Firefox & JavaScript: Problem and Solution ( page won't show )

  1. #1

    Firefox & JavaScript: Problem and Solution ( page won't show )

    This thread is for the purpose of being a reference and hopefully of some use to someone else, b/c when I did a search here and on the rest of the www, I found NOTHING to help me with my problem so I had to figure it out by myself (<-- run on sentence).

    I created and tested a website in the following browsers and the site worked perfectly in each: IE6, Opera 8.5, Maxthon. The HTML even validated as 4.01 Transitional and the CSS validated as well.

    Then I tested it in Netscape 8.1 using the Firefox (Fx) rendering engine (or should I say Mozilla rendering engine... oh well whatever) and whatya know, NOTHING, except "Not Found. The requested URL /no was not found on this server.". Well, well. I tested this and that and the other, and folks, I'm gonna save you a loooooooooooooooong story full of hours of frustration and get to the point.

    It all came down to this: I used a var called "location" in my .js file. Out of over 300 lines of js code, the site wouldn't show at all in Fx, just b/c of that ONE var, which was used ONE time. Yes, "location", I assume, is one of those reserved words. It is an object property (in this case, the property of the window object). Well, IE figured it out, Opera figured it out, but Fx couldn't, or just didn't feel like it.

    So I changed the var "location" to its spanish equivalent "locacion" and the page shows up perfectly in Fx. So there ya go...

    Now I won't say anything more about this, 'cause if I do, I'll only just end up pissing off a lot of Fx users.

    Hope this helps someone down the road.

    Peace...

  2. #2
    176
    posts
    Registered User
    well ... i tried this:
    HTML Code:
    <html>
    <head>
    <script language="javascript" type="text/javascript">
    function writeBlah(){
        var location='This text blah.';
        document.getElementById('blah').innerHTML=location;
    }
    </script>
    </head>
    <body onLoad="writeBlah();">
    <div id="blah"></div>
    </body>
    </html>
    and it worked for me

    window.location is the browser url ... you can set it or get it ... but location alone didnt cause my any head aches.
    Last edited by antizip; February 8th, 2006 at 11:02 AM.
    PHP Code:
    <zip> echo this; </zip

  3. #3
    Well, within a list of variables, I initialized the var earlier such as:

    var location = 'no';

    Then I used it such as:

    Code:
    winprops = 'width='+w+', height='+h+', top='+wint+', left='+winl+', menubar='+menu+', scrollbars='+scroll+', toolbar='+tool+', location='+location+', resizable='+resize+''
    Where later it gets run in the function:

    Code:
    function pleaseWork(){
     url = 'myWindow.htm';
     popUp = window.open(url, 'myWindowName', winprops);
     popUp.focus();
    }
    I added the var, then tested it, and it didn't work in Fx. Then I commented it out and tested it, and the page showed up. I repeated this at least 4 times! which produced the SAME results each and every time, so I came to the conclusion that that was the ONLY possible answer to the problem.

    Perhaps it could've been that it conflicted with something else, b/c I used the location property numerous times elsewhere in the .js file.
    Last edited by PCGamre; February 10th, 2006 at 02:02 PM.

  4. #4
    176
    posts
    Registered User
    Here's a list of reserved js words
    http://javascript.about.com/library/blreserved.htm
    PHP Code:
    <zip> echo this; </zip

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012