PDA

View Full Version : DHTML Window Widget: onClose load different content



salto
03-27-2007, 06:53 PM
1) Script Title: DHTML Window Widget

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm

3) Describe problem:
My DHTML window loads automatically as the webpage loads

var awin=dhtmlwindow.open("abox", "iframe", "page_a.htm", "title", "width=270px,height=330px,resize=1,scrolling=1,center=1", "recal")

Is it possible to load page_b.htm when awin is closed and after that allow the user to close the window?

I have been playing around with several awin.close functions and false returns, but it either does not work or I get errors on missing objects, so maybe it is not possible as an onClose event or I am too inexperienced, which is quite likely :( Therefore any help most welcome!
Thank you very much for your attention

ddadmin
03-28-2007, 11:01 AM
Try:


awin.onclose=function(){ //Run custom code when window is being closed (return false to cancel action):
awin.load("iframe", "http://cssdrive.com", "CSS Drive")
awin.onclose=function(){
return true
}
return false
}

salto
03-28-2007, 01:10 PM
Thank you very much for your help! I was obviously wrong on the false/true returns.
I observe one small issue: on closing awin, first the same content reloads (page_a.htm) after which the new content (cssdrive.com) appears. No idea if/how this can be remedied, if not, I can live with it.
Thank you for your kind interest.