Can you force a cell to unload?

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”);
});

An iframe object can be got by getFrame() method
var ifrm = myLayout.cells(“b”).getFrame();

ifrm.contentWindow - content window object

So, you may apply the necessary methods for the iframe.