CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    235

    contentDocument.body.appendChild gives error

    I got an iframe of different domain than mine and I got firefox security a little down by setting tis stuff to "allAccess".

    Now I can do frame.contentDocument.createElement("div"); all without any error (not even the permision denied) I can set the innerHTML all fine and dandy. The problem is when I use frame.contentDocument.body.appendChild. I resolved the permision denied issue by enabling firefox policies to allAccess but now I get this error:

    [Exception... "Node cannot be inserted at the specified point in the hierarchy" code: "3" nsresult: "0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR


    I want to append a div to the body of an iframe who's on a different domain. This is firefox specific and I don't care with compatibility. How can I resolve that issue?

    If I can execute javascript within the iframe that would be great. I have no control of coding of the site the iframe display's

    Thank you
    01101000011001010110110001101100011011110010000001110011011001010111100001111001

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: contentDocument.body.appendChild gives error

    Try...

    Code:
    frame.document.getElementsByTagName("body")[0].appendChild(element);
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured