SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: Firefox Annoyance
-
Aug 27, 2006, 13:12 #1
- 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
-
Aug 27, 2006, 13:44 #2
-
Aug 27, 2006, 19:06 #3
- 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
Code:function fadenav(URL){ top2bottom('close'); setTimeout('navURL("' + URL + '")', 300); } function navURL(URL){ location.href(URL); }
-
Aug 27, 2006, 19:23 #4
- 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?
-
Aug 28, 2006, 04:55 #5
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