Klaus Hartl wrote:
Robert O'Rourke schrieb:
Hello,
This ones for Dylan Verheul, I'm using your google maps plugin to
populate a map with various markers. I was just wondering about
adding the GUnload() function.
I've added this to the bottom of the $.fn.googlemap bit:
$("body").bind("unload", function(){ GUnload(); });
That should do the trick right?
Cheers,
Rob
I think this one does:
$(window).bind('unload', GUnload);
Note that you don't need an anonymous function if you already have a
reference to a function. Also the unload event handler is fired on the
window and attaching it to the body like the obtrusive way in the
Google Maps API examples will result in the same.
-- Klaus
That's great Klaus, thank you very much =]
I didn't know I could reference other functions like that, I should be
able to compress my code a bit more now.
Thanks again,
Rob