SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Dec 2008
    Location
    Plymouth, United Kingdon
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can manually assign the url. Firefox explcitly revents reload from within the resize event. https://bugzilla.mozilla.org/show_bug.cgi?id=258917

    window.location = "url..."

    You might consider seeing if there is a way to just have the google maps application readjust itself instead of reloading the page.

  3. #3
    SitePoint Evangelist
    Join Date
    Dec 2008
    Location
    Plymouth, United Kingdon
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by crmalibu View Post
    You can manually assign the url. Firefox explcitly revents reload from within the resize event. https://bugzilla.mozilla.org/show_bug.cgi?id=258917

    window.location = "url..."

    You might consider seeing if there is a way to just have the google maps application readjust itself instead of reloading the page.
    oic got it thanks. here is my solution instead of reload the page,

    Code:
    $(document).ready(function(){
    	$(window).resize(function(){	
    	googleMap();
    	});	
    	googleMap();
    });
    just 'reloading' the function googleMap in the resize()

    thanks.


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
  •