SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Iframe parent window and IE

    The following code is in an iframe. In the parent window the div "inline_images" should have the image from this script appear. Works great in Firefox, but IE vomits.

    Error:Invalid Argument

    Code JavaScript:
    var new_image = document.createElement('img');
    new_image.setAttribute( "src", "./images/small/filename.jpg");
     
    var imagebox = window.parent.document.getElementById('inline_images');
     
    imagebox.appendChild(new_image); // <--------------- IE Error is here :(

    Help!

  2. #2
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I fixed it using innerHTML instead of appendChild and it works now. I guess that's why people complain about IE having no love for the DOM.


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
  •