Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Dec 2008
    Posts
    117
    Thanks
    14
    Thanked 0 Times in 0 Posts

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

    Hi,
    I wonder why firefox won't work with this script below, but it works on IE, Safari, and Chrome instead?

    Code:
    $(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

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    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.

  • #3
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Does it work if you take the window.resize() out of inside the document.ready()?

  • #4
    Regular Coder
    Join Date
    Dec 2008
    Posts
    117
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fumigator View Post
    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...

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

  • #5
    Regular Coder
    Join Date
    Dec 2008
    Posts
    117
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Spudhead View Post
    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

  • #6
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Quote Originally Posted by lauthiamkok View Post
    I have tried that already, but it wont load the map at all...

    Code:
    $(document).ready(function(){
    	$(window).resize(function(){	
    		googleMap();	
    	});	
    
    });
    You need to call googleMap once when the page loads too.

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

  • #7
    Regular Coder
    Join Date
    Dec 2008
    Posts
    117
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fumigator View Post
    You need to call googleMap once when the page loads too.

    Code:
    $(document).ready(function(){
    	googleMap();	
    	$(window).resize(function(){	
    		googleMap();	
    	});	
    
    });
    yes you are right! it is now working better than reload

    thanks


  •  

    Posting Permissions

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