window.addEventListener('unload', function(e)
{
MyClass.shutdown();
window.removeEventListener('unload', /* how to refer to this function? */);
}, false);
window.addEventListener(‘unload’, function(e) { MyClass.shutdown(); window.removeEventListener(‘unload’, /* how to refer to this function? */); },
Share
Name your function.
Edit I think this will work too. Good point Kobi!