Results 1 to 4 of 4

Thread: Autoresize iframe don' work!

  1. #1
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Autoresize iframe don' work!

    Hi,

    I've tried the iframe autoresize script from Dynamic Drive,
    http://www.dynamicdrive.com/dynamici...messi2_dev.htm
    but it only works if the document inside the iframe is on the same server.

    I have two webservers and I want to be able to show webpages from webserver 2 inside the iframe on webserver 1. Is this possible?

    Firefox generate following error in the Javascript console:
    Error: [Exception... "'Permission denied to get property HTMLDocument.body' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]

    Thanks

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Using absolute paths may help.

    One thing you haven't made clear is -

    Is the error the result of showing the content in the iframe, or is it the result of the content attempting to resize the iframe?

    An obvious approach would be to put the pages all on one server, use the extra server only for content that doesn't cause a problem.

    Another approach would be to put the resizable iframe on the remote server and an additional fullpage iframe or, a frame page with only one frame, on the main server to contain all that.

    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm using absolute paths. The error shows up when I load the page with the iframe. I don't have any problems when the iframe source file is local but as soon as I try to load an external page the error pops up and the iframe don't resize anymore. I've found several autoresize scripts but they all have the same problem with cross domain.

    It seems to be a security issue. I've found some documentation at
    http://msdn.microsoft.com/library/de...tingframes.asp
    and
    http://msdn.microsoft.com/library/de...tingframes.asp

    I'm not a JS expert, so I don't know how to solve the problem if it can be solved.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by jscheuer1
    Another approach would be to put the resizable iframe on the remote server and an additional fullpage iframe or, a frame page with only one frame, on the main server to contain all that.
    Have you tried this suggestion?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •