Robert O'Rourke schrieb:
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
Your welcome! If you keep in mind that
function GUnload() {
}
is the same as (is a shortcut for that is)
var GUnload = function() {
};
that makes it clearer I guess.
-- Klaus