SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Obsessive designer Infizi's Avatar
    Join Date
    May 2004
    Location
    North Pole
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Firefox Annoyance

    Hi,

    Im trying to use document.location.href in firefox. I've searched google, and found lots of suggestions that i have tried, but none of these will work in firefox. Does anyone know a good alternated method or fix?

    These dont work.
    document.location
    document.location.href
    window.location
    window.location.href

    The site:
    www.andyguard.com

    thanks for your help
    New Design - PHP Slowly flowing in!

    Infizi Studio's

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Use location.href
    Saul

  3. #3
    Obsessive designer Infizi's Avatar
    Join Date
    May 2004
    Location
    North Pole
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that doesnt appear to work?

    Heres the code leading to it
    HTML Code:
    <a class="white_title" href="javascript:fadenav('http://www.andyguard.com');">andyguardtextiledesign
    goes to

    Code:
    function fadenav(URL){
    	top2bottom('close');
    	setTimeout('navURL("' + URL + '")', 300);
    }
    function navURL(URL){
    	location.href(URL);
    }
    thanks
    New Design - PHP Slowly flowing in!

    Infizi Studio's

  4. #4
    Obsessive designer Infizi's Avatar
    Join Date
    May 2004
    Location
    North Pole
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fixed!!

    Ok, i found a helpfull link to some other code

    I found that the compatiable way to do this in IE and FF is using the following

    window.document.location = "www.myurl.com";


    I found that Firefox actually evaluates window.location(URL) etc etc and finds that is is not an actual function and hence, fails. I guess IE has some support written into it for addressing this as a function instead of a sum?
    New Design - PHP Slowly flowing in!

    Infizi Studio's

  5. #5
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It didn't work because you used it as a function while href is a property. If you wanted to redirect you should have used it like this:
    Code:
    location.href = URL;
    Saul


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
  •