Results 1 to 3 of 3

Thread: DHTMLmodal window won't close

  1. #1
    Join Date
    Feb 2012
    Location
    N Wales
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question DHTMLmodal window won't close

    1) DHTML Modal window v1.1

    2) http://www.dynamicdrive.com/dynamici...dhtmlmodal.htm

    3) I am using this script on
    www.tremyfoel.co.uk
    on this home page its working.
    I then set up a page
    www.tremyfoel.co.uk/linkpopup2.htm
    with the code to allow others to use the interactive map. When this code is pasted into another page - SEE
    http://www.probusllandudno.org.uk/windowtest.htm
    - this works BUT for some reason the pop up window (the map) won't close when the X is clicked - seems to reload? I get an error msg (in IE) error modal.js line 55 char 2 - which is the close function.
    NB the dhtmlwindow.js was renamed dhtmlwindow1.js when I edited the urls to the graphics files to full urls thats the only difference
    NB2 the css is all in javascripts.css
    Can't see what the problem is any help appreciated.
    Last edited by marcusbmig; 02-12-2012 at 06:18 PM. Reason: addendum

  2. #2
    Join Date
    Aug 2004
    Posts
    9,889
    Thanks
    3
    Thanked 964 Times in 953 Posts
    Blog Entries
    15

    Default

    This is due to the page you're trying to open inside the modal window being from a different domain than the page opening it. By default the script tries to access the document object of the former, which in this case throws an error.

    Try the below modified modal.js file, which silently suppresses this error in such an event.
    DD Admin

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

    marcusbmig (02-12-2012)

  4. #3
    Join Date
    Feb 2012
    Location
    N Wales
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I have tested this and the problem looks like its solved - well done. I understand entirely the cause of the error now that you have identified it but my javascript knowledge not enough to fix it.
    Bravo sir!

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
  •