Results 1 to 8 of 8

Thread: DHTML Window widget not updating window content in IE

  1. #1
    Join Date
    Dec 2006
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default DHTML Window widget not updating window content in IE

    1) Script Title: DHTML Window widget

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

    3) I can't seem to get new content to load in the same window from a div in IE.
    Here's the initial call:
    Code:
    <a onclick="resortwin=dhtmlmodal.open('divbox2', 'div', 'resort_details', 'Resort Details', 'width=480px,height=360px,center=1,resize=1,scrolling=1'); return false">View resort details</a>
    In a div with id 'resort_details' I have several of these:
    Code:
    <a class="red" onclick="resortwin.load('div', 'tt_any_value_resort', 'Resort Details'); return false"><strong>Any Value Resort</strong></a>
    It should load what little info I have from another div with id 'tt_any_value_resort'. This method works fine in Firefox, but IE doesn't respond to the click and gives me a JS error that says 'resortwin' is undefined. Also, IE 6 shows the dropdown boxes through the window.

    Here's a link to my work in progress: http://www.gomylo.com/clients/3d/registration.html

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

    Default

    Instead of loading a DIV (resort_details), have you considered using the IFRAME option of DHTML window to simply load an external page instead? Since your loaded content in turn contains a host of links to other content, it makes a lot more sense (and is more efficient) to simply load an external page, with that page containing regular links to the final destination pages.

  3. #3
    Join Date
    Dec 2006
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    I was trying to keep the calls all the same as instructed. And since all of the content for each resort ends up being very miniscule in quantity, I was going to just use the div method. I have 30 resorts with a couple of sentences of info and a pic. I'm trying to avoid making 30 new pages for the info.

    Can I call an external file that contains the resort_details div info and still call all of the resort info via the div method? In other words, can I use the IFRAME method followed by the DIV method and get away with it?

  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 bradymc View Post
    I was trying to keep the calls all the same as instructed. And since all of the content for each resort ends up being very miniscule in quantity, I was going to just use the div method. I have 30 resorts with a couple of sentences of info and a pic. I'm trying to avoid making 30 new pages for the info.

    Can I call an external file that contains the resort_details div info and still call all of the resort info via the div method? In other words, can I use the IFRAME method followed by the DIV method and get away with it?
    I see, in that case, it makes sense to do what you're currently doing already. I looked into the problem in more detail. There's definitely something specific to your page that's causing IE to not register a variable when it's being created via the onClick event. For example, this is your initial HTML to launch the DHTML window:

    Code:
    <td width="185"><a onclick="resortwin=dhtmlmodal.open('divbox2', 'div', 'resort_details', 'Resort Details', 'width=480px,height=360px,center=1,resize=1,scrolling=1'); return false">View resort details</a></td>
    Which I replaced with something much simpler to try and catch the problem:

    Code:
    <td width="185"><a href="#" onClick="george=5; return false">View resort details</a> <a href="javascript:alert(george)">Report</a></td>
    When I click "view resort", then "report", 5 should be alerted, signaling that variable george was correctly defined. In IE, however, it returns undefined. This is the same issue causing IE to return "resortwin" not found.

    Most likely the problem is due to some unclosed or invalid HTML on your page throwing IE off. At first I thought it's because your <a> tags are all missing the href attribute, but even adding it in didn't help. I'd start by stripping your page first of everything except the relevant parts to do with this script, and see if you can isolate what HTML (or lack thereof) is causing the problem.

  5. #5
    Join Date
    Dec 2006
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    I did as you suggested and starting stripping down the page. I thought it may have been some of my hacking at JS that was causing the problem, but I've deducted that the offending tag is <form></form>.

    When the call for the window is enclosed within the form tags, IE cries foul (http://www.gomylo.com/clients/3d/test.html).

    When you remove the form tags, everything starts working again (http://www.gomylo.com/clients/3d/test2.html).

    And that sucks since I need this to work in the flow of a form. Do you have any suggestions on a workaround?

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

    Default

    IE sure loves to throw people curve balls eh. One thing that works from my testing is this:

    Code:
    <td width="185"><a onclick="parent.resortwin=dhtmlmodal.open('divbox2', 'div', 'resort_details', 'Resort Details', 'width=480px,height=360px,center=1,resize=1,scrolling=1'); return false">View resort details</a></td>
    The code in red is new. With that added, you're telling the browser to explicitly add the returned variable to the window object. IE seems to be adding it to the FORM or God knows where.

  7. #7
    Join Date
    Dec 2006
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    Well, that did the trick!

    Yeah, IE deserves a whack in the back of their status bar with a big stick of RAM... a BIG stick of RAM!!!

    Thanks for your help and thanks for the great scripts. Where do I donate?

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

    Default

    Quote Originally Posted by bradymc View Post
    Well, that did the trick!

    Yeah, IE deserves a whack in the back of their status bar with a big stick of RAM... a BIG stick of RAM!!!

    Thanks for your help and thanks for the great scripts. Where do I donate?
    You're welcome. Thanks is more than enough.

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
  •