Results 1 to 3 of 3

Thread: Dhtml closeit() function

  1. #1
    Join Date
    Oct 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dhtml closeit() function

    Hello, I am looking for help with :
    DHTML Window
    http://www.dynamicdrive.com/dynamici...htmlwindow.htm

    I am trying to call the closeit() function with a link :
    <a href = "javascript:closeit()">Return to list </a> and
    get an error on first line in the function :
    document.getElementById("dwindow").style.display="none"

    Is there a syntax I can use from a link to do this?
    Many thanks!

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

    Default

    If you're calling closeit() from within the DHTML window (ie: the link is inside the DHTML window), you'll need to use something like:

    Code:
    <a href="javascript:parent.closeit()">Close</a>
    Important: The above code will only work inside the DHTML window if that page is from the same domain as the main page calling the window. If not, a security error will occur, as JavaScript cannot cross over to a different domain than the one it's on.

  3. #3
    Join Date
    Oct 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks...that's what I needed

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
  •