View Full Version : Iframe SSI script II

01-28-2005, 06:34 PM

It appears from this forum that most people are not having problems with this script working at a very basic level. However, I can not seem to even get it to work at all. Using Frontpage 2002 as my editor (my shame), the code gives the following script error on preview:

Line: 45
Char: 6
Error: Permission Denied

When I hunted this down, it appears that it is having trouble with the if statement in the following line:

else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax

All referenced pages exist in the same root web directory. If the scripted page is saved regardless and viewed from eithe IE6 or FF, the resizing does not work, understandably. Is this just a security setting issue with my browser or a code issue? I'm not astute enough to know just yet.


02-01-2005, 12:30 AM
Hmmm if you're getting a permission denied error, it almost always points to one of the loaded page in the iframe not belonging to the same domain as the page the iframe is on. Due to JavaScript security limitations, all pages within the iframe (and outside) must belong to the same domain, otherwise, the script cannot get the height for that page that is of another domain.

02-01-2005, 03:43 PM
Thank you for looking at this, however, I finally figured it out myself. I did not notice that my extant iframe parameters, although having a name="---" variable, did not have an id="---" variable set. Adding this removed the error. FF and Netscape resize the frame beautifully, while IE does attempt to resize but pads a sizeable border around the iframe document, i.e. it is not as tight of a resize as the other browsers, which shrink the iframe to just enough to display the document. Any ideas on this?

02-01-2005, 11:44 PM
Do you have any extra attributes inside the <iframe> tag that may be creating the border? Also, if the document contained inside the iframe have addiitonal padding or margin, that may cause what you're seeing as well.