| | |
Problem with window.location in Safari (mac only)
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2007
Posts: 2
Reputation:
Solved Threads: 0
I have a web site where we have a few elements that call javascript functions on the onclick. The javascript functions will do some processing and what not and eventually call a window.location to change the url. In Safari (mac only) window.location is not being processed until the current page is fully loaded.
This is hard to reproduce because most sites load up pretty fast, but on our site we have different tracking / logging pixels that sometimes take a while for the page to 'fully' load so if I click any of these elements that do a window.location call, the page will not change until the current page is loaded.
I haven't been able to find a way around this. This works fine in IE, Firefox, and Safari for Windows but not on the Mac version. I also thought okay maybe I could just stop the page from loading, but I haven't found an equivalent for window.stop() in Safari.
Any help is greatly appreciated.
Thanks,
Victor
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
window.location = 'http://google.com';
This is hard to reproduce because most sites load up pretty fast, but on our site we have different tracking / logging pixels that sometimes take a while for the page to 'fully' load so if I click any of these elements that do a window.location call, the page will not change until the current page is loaded.
I haven't been able to find a way around this. This works fine in IE, Firefox, and Safari for Windows but not on the Mac version. I also thought okay maybe I could just stop the page from loading, but I haven't found an equivalent for window.stop() in Safari.
Any help is greatly appreciated.
Thanks,
Victor
•
•
Join Date: Aug 2007
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
Some browsers do not do ANY processing until the download of the initial page is complete. This is beyond your control. You need to allow for this when designing your pages.
I've been trying to figure out ways around it, but nothing has come to mind yet. We have a search box that dynamically builds your url depending on what you entered, and what check boxes you checked, but clicking the search button won't replace the window.location because of the page not fully loaded.
The only thing I can think of is having the script load some of the time-consuming stuff with a delayed call, after doing the window sizing.
I had to deal with timing issues like this here:
http://www.daniweb.com/forums/thread85060.html
I had to deal with timing issues like this here:
http://www.daniweb.com/forums/thread85060.html
Last edited by MidiMagic; Aug 24th, 2007 at 12:45 am.
Daylight-saving time uses more gasoline
> http://www.daniweb.com/forums/thread85060.html
I think this thread is turning out to be a kind of reference to all those beaten up by timing issues... ;-)
And BTW, its actually
I think this thread is turning out to be a kind of reference to all those beaten up by timing issues... ;-)
And BTW, its actually
window.location.href = 'http://www.google.com' and not window.location = 'http://www.google.com' since location is an object _not_ of type String. I don't accept change; I don't deserve to live.
![]() |
Similar Threads
- Power Mac G4 problem (OS 7 / 8 / 9)
- Iframe opening new window problem (HTML and CSS)
- Mac, "Plug In," (OS X)
- Wait some time and after that redirect another Location (PHP)
- Problem with window.open in Netscape7.2 (HTML and CSS)
- window location using frames (JavaScript / DHTML / AJAX)
- New window not savable in Safari (HTML and CSS)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: How to restrict the entry of alphabets in a textbox using javascript...?
- Next Thread: what is active X?
| Thread Tools | Search this Thread |
ajax ajaxcode ajaxexample ajaxjspservlets array browser bug calendar captchaformproblem cart checkbox child class close codes cookies createrange() cursor date debugger dependent disablefirebug dom dropdown editor element embed engine enter events explorer ext file firefox form forms frameworks getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe image() images internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl maps masterpage math media object onerror onmouseoutdivproblem onreadystatechange parent paypal pdf php position post programming progressbar prototype redirect regex runtime safari scale scriptlets scroll search security session shopping size software sql text textarea toggle unicode variables web webservice windowsxp wysiwyg \n






