I am using a layout and need to preform events just before the page is navigated away from.
I use a simple attach layout as seen below and often change it dynamically
myLayout.cells(‘b’).attachURL(“newpage.html”);
on the “newpage.html” I do the following
$(window).unload(function () {
alert(“Stuff I need to do”);
});