Results 1 to 9 of 9

Thread: window.location error on firefox

  1. #1
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default window.location error on firefox

    Hi, i have problem with window.location.
    This is a weird error, i already try the page at safari, opera, chrome, ie.7 and ie.8 everything is fine.
    The problem appear only on firefox.

    this is the the website

    it should be moved to the second section, when it first shows. But not in firefox, it show the first section.

    Thanks in advanced
    Last edited by davelf; 11-22-2011 at 07:52 AM.
    _____________________

    David Demetrius // davejob
    _____________________

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It doesn't appear to work in IE 9 either, not even IE 9's IE 8 or IE 7 modes. It does work in Opera. What's the exact code? What script is it in. I looked but I couldn't find it.

    Edit: I looked at this a little bit more (now it is working in IE 9, guess it had to be cached?) and still couldn't find it. But it looks like if you get rid of whatever it is and instead put this as the last thing at the end of move.html (just before the closing </body> tag):

    Code:
    <script type="text/javascript">
    jQuery(function($){
    	$('a[href=#section2]').eq(0).click();
    });
    </script>
    That should do it.

    The browser cache may need to be cleared and/or the page refreshed to see changes.
    Last edited by jscheuer1; 11-21-2011 at 06:43 PM. Reason: found potential solution
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    davelf (11-22-2011)

  4. #3
    Join Date
    Jul 2008
    Posts
    128
    Thanks
    0
    Thanked 17 Times in 16 Posts

    Default

    Firebug indicates that the page is failing to load three different script files.
    I'd fix that first.

    "NetworkError: 404 Not Found - http://imaxxo.net/stbaldo/script/sprite/scripts/jquery-1.3.2.min.js"
    jquery....min.js
    "NetworkError: 404 Not Found - http://imaxxo.net/stbaldo/script/footer/foot.js"
    foot.js
    "NetworkError: 404 Not Found - http://imaxxo.net/stbaldo/script/footer/head.js"

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by clueful View Post
    Firebug indicates that the page is failing to load three different script files.
    I'd fix that first.

    "NetworkError: 404 Not Found - http://imaxxo.net/stbaldo/script/sprite/scripts/jquery-1.3.2.min.js"
    jquery....min.js
    "NetworkError: 404 Not Found - http://imaxxo.net/stbaldo/script/footer/foot.js"
    foot.js
    "NetworkError: 404 Not Found - http://imaxxo.net/stbaldo/script/footer/head.js"
    Yes, but I don't think that matters here. See my previous post in this thread for the solution. But you're right, those should be fixed. Probably just have those tags removed, as the page doesn't appear to need those files.

    I did finally find where the window.location thing was coming from. It's on a separate page, the hard coded source of the iframe (index-move.html):

    Code:
    <body onLoad="window.location.replace('move.html#section2')"; >

    This would probably work in Firefox if you made it:

    Code:
    <body onLoad="window.location.replace('move.html#section3')"; >
    But that would throw off all the others. My solution - add:

    Code:
    <script type="text/javascript">
    jQuery(function($){
    	$('a[href=#section2]').eq(0).click();
    });
    </script>
    to the end of the real target page (move.html). Put it right before the closing </body> tag. It should work. If not, do it anyway and let me check the page to see what the problem is.

    The browser cache may need to be cleared and/or the page refreshed to see changes.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #5
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default

    Bad news John, there's still an error on firefox.
    You can check it again at: http://www.imaxxo.net/stbaldo

    (i already clear the cache & cookies too)
    _____________________

    David Demetrius // davejob
    _____________________

  7. #6
    Join Date
    Jul 2008
    Posts
    128
    Thanks
    0
    Thanked 17 Times in 16 Posts

    Default

    Quote Originally Posted by davelf View Post
    Bad news John, there's still an error on firefox.
    You can check it again at: http://www.imaxxo.net/stbaldo

    (i already clear the cache & cookies too)
    Of course there's an error because it's still failing to load files that aren't there, and
    Code:
    function init() {
      disableDraggingFor(document.getElementById("draggingDisabled"));
    }
    Is addressing an element that doesn't exist.

    If you load your iframe document directly, you'll see that the redirect works properly in Firefox.

  8. The Following User Says Thank You to clueful For This Useful Post:

    davelf (11-22-2011)

  9. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, yes. Fix those script errors. They're not helping. But I have seen this before, Firefox not reacting to the hash as expected in an iframe. One other thing to try if after fixing those other errors doesn't take care of it, change the added script from:

    Code:
    <script type="text/javascript">
    jQuery(function($){
    	$('a[href=#section2]').eq(0).click();
    });
    </script>
    to:

    Code:
    <script type="text/javascript">
    jQuery(window).load(function(){
    	jQuery('a[href=#section2]').eq(0).click();
    });
    </script>
    And yeah, you shouldn't need that redirect, but I see how without it things get screwy in IE.

    If you use just move.html as the src attribute of the iframe, fix the script error:

    Error: element is null
    Source File: http://www.imaxxo.net/stbaldo/move.html
    Line: 46
    it should be fine with just the script we just added or the window load one in this post.

    But I'm still scratching my head as to why, if you make the src attribute of the iframe move.html#section2 - why in IE that seems to load a blank page into the iframe. Any idea why that's happening? #section1 and #section3 are fine in IE, just #section2 does that.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. The Following User Says Thank You to jscheuer1 For This Useful Post:

    davelf (11-22-2011)

  11. #8
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default

    Quote Originally Posted by clueful View Post
    Of course there's an error because it's still failing to load files that aren't there, and
    Is addressing an element that doesn't exist.

    If you load your iframe document directly, you'll see that the redirect works properly in Firefox.
    @clueful.
    Thanks for the error check, i already move that part you said it's an error.
    Technically it's not, that's my id name to block all image select by user.
    But it's like you said before, the iframe document read it as a critical error.
    So, after i remove that part and combine it with John script everything work perfectly.

    @John
    Thanks John your second script work perfectly.

    this is the result
    _____________________

    David Demetrius // davejob
    _____________________

  12. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Not exactly. I notice that in Firefox, if you refresh the page it loads up the Women's panel. Not sure how or if that needs fixing.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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