...

View Full Version : jquery: reload location when window is resizing - firefox won't work!



lauthiamkok
11-24-2009, 03:37 PM
Hi,
I wonder why firefox won't work with this script below, but it works on IE, Safari, and Chrome instead?


$(document).ready(function(){
$(window).resize(function(){
location.reload();
});
googleMap();
});

The reason to reload the page is to reload the google map when the window is being resized.

Here is the link to look at,
http://artonyourdoorstep.org.uk/googlemap/index.php

It would be appreciated if you know the way to get around to it. thanks.
Lau

Fumigator
11-24-2009, 04:40 PM
I couldn't solve the problem with reload in FF. The function call is returning false, indicating it failed.

But really, what's the point of reloading? To reload the map? Why not just call that googleMap() function when the window is resized? That worked great.

Spudhead
11-24-2009, 05:03 PM
Does it work if you take the window.resize() out of inside the document.ready()?

lauthiamkok
11-24-2009, 06:22 PM
I couldn't solve the problem with reload in FF. The function call is returning false, indicating it failed.

But really, what's the point of reloading? To reload the map? Why not just call that googleMap() function when the window is resized? That worked great.

I have tried that already, but it wont load the map at all...


$(document).ready(function(){
$(window).resize(function(){
googleMap();
});

});

lauthiamkok
11-24-2009, 06:24 PM
Does it work if you take the window.resize() out of inside the document.ready()?

I have not tried this yet. but how do I load the the google map and other stuff if without the document.ready()?

thanks,
L

Fumigator
11-24-2009, 06:59 PM
I have tried that already, but it wont load the map at all...


$(document).ready(function(){
$(window).resize(function(){
googleMap();
});

});

You need to call googleMap once when the page loads too.


$(document).ready(function(){
googleMap();
$(window).resize(function(){
googleMap();
});

});

lauthiamkok
11-24-2009, 10:31 PM
You need to call googleMap once when the page loads too.


$(document).ready(function(){
googleMap();
$(window).resize(function(){
googleMap();
});

});

yes you are right! it is now working better than reload :thumbsup:

thanks :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum