Results 1 to 3 of 3

Thread: DHTML Window Widget: onClose load different content

  1. #1
    Join Date
    Sep 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DHTML Window Widget: onClose load different content

    1) Script Title: DHTML Window Widget

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

    3) Describe problem:
    My DHTML window loads automatically as the webpage loads
    Code:
    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

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Try:

    Code:
    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
    }

  3. #3
    Join Date
    Sep 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •