Results 1 to 4 of 4

Thread: Iframe SSI script II

  1. #1
    Join Date
    Jan 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Iframe SSI script II

    http://www.dynamicdrive.com/dynamici...iframessi2.htm

    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.

    don

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

    Default

    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.

  3. #3
    Join Date
    Jan 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

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

    Default

    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.

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
  •