IE 8 is correct. Other browsers would probably agree. The script wasn't expecting anything other than an HTML page there. A PDF file has no javascript document object. But you shouldn't need a reference to it to close the dhtml Modal window. I suspect you're using the same dhtml Modal window that you used for the form. That window is probably looking for the form to know whether or not it's allowed to close and/or what it should do as it closes. Perhaps you have something like this:
Code:
var agreewin=dhtmlmodal.open("agreebox", "iframe", "modalfiles/agreement.htm", "This Page's Terms of service", "width=590px,height=450px,center=1,resize=1,scrolling=0", "recal")
agreewin.onclose=function(){ //Define custom code to run when window is closed
var theform=this.contentDoc.getElementById("eula") //Access form with id="eula" inside iframe
var yesbox=theform.eulabox[0] //Access the first radio button within form
var nobox=theform.eulabox[1] //Access the second radio button within form
if (yesbox.checked==true)
alert("You agreed to the terms")
else if (nobox.checked==true)
alert("You didn't agree to the terms")
return true //Allow closing of window in both cases
}
Either use a different dhtml Modal window, one without that check. Or you could try this approach (additions changes/highlighted):
Code:
var agreewin=dhtmlmodal.open("agreebox", "iframe", "modalfiles/agreement.htm", "This Page's Terms of service", "width=590px,height=450px,center=1,resize=1,scrolling=0", "recal")
agreewin.onclose=function(){ //Define custom code to run when window is closed
var theform;
try { //does this iframe contain a javascript document object?
theform = this.contentDoc.getElementById("eula") //Access form with id="eula" inside iframe
} catch(e){ //if not:
return true; //allow closing of window
}
var yesbox=theform.eulabox[0] //Access the first radio button within form
var nobox=theform.eulabox[1] //Access the second radio button within form
if (yesbox.checked==true)
alert("You agreed to the terms")
else if (nobox.checked==true)
alert("You didn't agree to the terms")
return true //Allow closing of window in both cases
}
The browser cache may need to be cleared and/or the page refreshed to see changes.
There could be other problems. If you want more help:
Please post a link to a page on your site that contains the problematic code so we can check it out.
Bookmarks