Hmmm is there a reason why you aren't simply using the onclose() event handler of DHTML window to run your custom function when a window is closed? With regards to getting the URL of the document inside a DHTML window, assuming you're using the IFRAME option, you could use the code window.frames["_iframe-"+t.id] to reference the IFRAME window as a FRAME object.
Altogether, here's an example:
Code:
var mywin=dhtmlwindow.open("pagebox", "iframe", "test.htm", "My Web site", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")
mywin.onclose=function(){ //Run custom code when window is being closed (return false to cancel action):
alert("The DHTML window you're about to close contains the URL "+window.frames["_iframe-pagebox"].location.href)
return true //allow closing of window to proceed
}
The key to realize though is that you can only probe window.frames["_iframe-"+t.id] if the document contained inside the IFRAME belongs to the same domain as the page containing the DHTML wndow. Otherwise, a call to window.frames["_iframe-"+t.id].location will silently throw an error instead, as cross domain access isn't allowed in JavaScript.
Bookmarks