Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Trouble with DHTML window widget

  1. #1
    Join Date
    Aug 2006
    Posts
    27
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Trouble with DHTML window widget

    1) Script Title: DHTML Widget

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

    3) Describe problem:

    All I am trying to do is add a simple text link to close the window.

    You can see my popup in action here: www.musclegaintruth.com

    Based on this coding I was told to use:

    <a href="#" onClick="popwindow.close(); return false">Close Window</a>

    I did this but when I click the text link I just get "error on page" at the bottom and the window just stays open.

    I had a guy slightly modify this script for me a while back to accomodate the video inside (the sound of the video would continue to play despite closing the window), and so I'm thinking maybe this is interfering somehow.

    Can someone please take a quick look at my page and tell me what I need to do to get the window to close with a text link?

    Any help would be awesome,

    Thanks,

    Sean

  2. #2
    Join Date
    Aug 2006
    Posts
    27
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Anyone?

  3. #3
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    you have to post HELP.. HELP.. HELP.. four five times then somone could help.. I'm sorry i don't know anything about it but just letting you know how everyone behaves here..

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

    Default

    Quote Originally Posted by ff123 View Post
    you have to post HELP.. HELP.. HELP.. four five times then somone could help.. I'm sorry i don't know anything about it but just letting you know how everyone behaves here..
    Actually, everyone here behaves like they should, which is help out as much as possible as time permits. There will always be gaps in the response times when our schedules are more busy than usual, like this week for me.

    To the OP's question, I don't see a "Close" window link on your page now to test out. But if popwindow.close() doesn't work for some reason, try popwindow.hide() instead.
    Last edited by ddadmin; 06-11-2008 at 07:04 PM.

  5. #5
    Join Date
    Aug 2006
    Posts
    27
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    In my experience everyone on this board is extremely kind and helpful...Sorry I bumped my own post but I really want to get this solved asap.

    So I tried using:

    <a href="#" onClick="popwindow.hide(); return false">Close</a>

    But it still won't work... I took the close link off the popup since it wasn't working but have left it on temporarily.

    Popup at www.musclegaintruth.com

    Popup contents at www.musclegaintruth.com/windowcontents-test.htm

    Any thoughts?

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

    Default

    I see the problem. You're putting the Close link inside the DHTML window via IFRAME mode. That means it's actually on a separate page. Due to this, you need to access close() in the parent window's document that actually contains the script:

    Code:
    <a href="#" onClick="parent.popwindow.hide(); return false">Close [X]</a>

  7. #7
    Join Date
    Aug 2006
    Posts
    27
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks - I made the change to the code, and the link now closes the popup in firefox, but for some reason in IE it still gives me the error message.

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

    Default

    Make sure IE isn't caching the page inside the IFRAME. To check, view source for the page inside the IFRAME, and see if the link has been updated correctly.

  9. #9
    Join Date
    Aug 2006
    Posts
    27
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Yup, I did this and checked and the link is updated properly but still getting the error.

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

    Default

    Ok I see the problem- it's a permission error in IE. Basically, on your main page, you're calling dhtmlwindow.open() with an absolute URL to the page:

    Code:
    	popwindow=dhtmlwindow.open("popwindow", "iframe", "http://musclegaintruth.com/windowcontents-test.htm", "ACCESS YOUR FREE GIFT BELOW!", "width=462px,height=379px,resize=0,scrolling=0,center=1","recal")
    Try changing that to a relative URL:

    Code:
    	popwindow=dhtmlwindow.open("popwindow", "iframe", "windowcontents-test.htm", "ACCESS YOUR FREE GIFT BELOW!", "width=462px,height=379px,resize=0,scrolling=0,center=1","recal")

  11. The Following User Says Thank You to ddadmin For This Useful Post:

    Seannal (06-12-2008)

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
  •