Results 1 to 12 of 12
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    A difference between IE and Firefox (All)

    I found a difference in behavior between IE and Firefox.
    Somebody else confirmed the difference, also using Safari.
    He then reported the problem as Bugzilla bug 272126.

    I was was wondering what would be the behavior in Opera, Netscape and Mozilla.
    The following attempts to describe the problem and provides a means to test the behavior.
    -------------------
    I now see what is happening that is different between IE and Firefox.

    For example, using a URL of the form http://www.standards.com/index.html#XXX,
    where XXX is any of the 41 values that I specify in my javascript, IE does what
    I intended and takes the user to the correct page. Where XXX is "Standards" or
    "Temporary" or "ThisandThat", the target document is actually index.html itself.

    IE handles all 41 cases as I intended, however, for the three targets that are
    actually in index.html, Firefox causes the script to be called a second time.
    The code looks like it is running correctly each time, i.e., it
    executes the following statement.

    location.replace(URLList[locSearch]);

    Somehow, the 2nd pass thru the script using Firefox is causing a problem for
    those three cases. You can see the behavior by using IE and Firefox with the
    links in http://www.standards.com/test-links-global.html

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: A difference between IE and Firefox (All)

    Maybe you should detect that the identical URL is being reloaded and just return rather than trying to reload it?

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: A difference between IE and Firefox (All)

    I could do that, but the purpose is to go to the anchor, so I'd have to reload anyway.
    Perhaps I could do that without specifying the file, just the bookmark. I'll have to try that.

    If IE and SAfarai can handle this, dunno why Firefox couldn't.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: A difference between IE and Firefox (All)

    > the purpose is to go to the anchor, so I'd have to reload anyway.

    Oh, I forgot about the ? style link. The above would be true with the ? style, but the # style link should go directly to the bookmark if you simply used return.

    As for why it does what it does, perhaps the recursion is a problem for Mozilla/Firefox?

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: A difference between IE and Firefox (All)

    The problem is even deeper.

    Instead of using, say inde.html?XXX, I tried going via finder.html?XXX.
    Same problem.

    Firefox seems to be doing something odd with index.html.

    I added these files to the test case.

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: A difference between IE and Firefox (All)

    Here's something I didn't realize: Firefox's hashes are case sensitive. <img src=/S/blackteeth.gif border=0 alt=blackteeth width=20 height=20>

    I can give you a fix for the ?Standards (or ?Standards) syntax:

    Existing Line: locSearch = locSearch.slice(ptrlastIndexOf);
    New Next Line: var jfs = locSearch + location.search + location.hash;

    In the if loop that starts after SetURL(), add this structure between the if and else clauses:

    else if (URLList[locSearch].toLowerCase() == jfs.replace(/?/,/#/).toLowerCase())
    {
    location.hash = URLList[locSearch].slice(URLList[locSearch].lastIndexOf("#"));
    }

    Maybe this will help.

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: A difference between IE and Firefox (All)

    Thanx

    I'll give it a try.
    That would indeed be a significant difference between IE and Firefox.

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: A difference between IE and Firefox (All)

    I see that you took the approach of special casing the case in which the target is in index.html.
    I had started to code that approach yesterday.
    I needed your kick in the butt to finish up.

    I have rewritten the javascript so it avoids the different behavior in Firefox.

    This does not explain why Firefox behaved differently than IE or Safari.

    Thanx.

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: A difference between IE and Firefox (All)

    I believe that the script I just put at my web site can be used to see the difference between IE and Firefox.

    In line 83, if you replace

    location.hash = flag;

    with

    location.replace(flag);

    One can see the difference between IE and Firefox that I noticed in my original posting.

    Use the test source that I previously posted.

  10. #10
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: A difference between IE and Firefox (All)

    I agreed there was a difference, and will leave all further testing to you and the folks at the Mozilla forums.

  11. #11
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: A difference between IE and Firefox (All)

    I, the party of the first part, hereby do agree with you, the party of the second part, that we, the parties of the first part and the party of the second part, do agree that we shall let others, the parties of the Nth part, deal with the matter at hand.

  12. #12
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: A difference between IE and Firefox (All)

    Interested, or not, parties may follow the soap opera at https://bugzilla.mozilla.org/show_bug.cgi?id=272126.

Posting Permissions

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