Results 1 to 2 of 2

Thread: close and open dhtml window using same variable name

  1. #1
    Join Date
    Mar 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default close and open dhtml window using same variable name

    1) Script Title: DHTML Window widget (v1.1)

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

    3) Describe problem: hi, i need to reopen the dhtml window that i closed before using same variable name (because i'm gonna use this variable name further), here is my code

    function opennewwindow(targetname)
    {
    if (!infowindow[targetname])
    {
    infowindow[targetname]=dhtmlwindow.open("infowindow"+targetname,"iframe","infowindow.php?target="+targetname,targetname,"width=590px,height=350px,resize=1,scrolling=1,center=1","reca l");
    infowindow[targetname].onclose=function()
    {
    setInterval("deleteinfowindow('"+targetname+"')",100);
    }
    }
    }
    function deleteinfowindow(targetname)
    {
    delete infowindow[targetname];
    }

    but when i close the dhtml window
    and then reopened it (say i'm using a link to run the function opennewwindow('abcd'))
    then the variablename should be infowindow['abcd'] right?
    but i cannot access that variable, that variable doesn't exist like the first time i open that dhtml window using that name

    anyone can help?
    thx

  2. #2
    Join Date
    Mar 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok sorry, my bad, i made a silly mistake
    i shouldn't have used setInterval
    i should have used setTimeout..
    btw thx anyway

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
  •