Your iframe has no src attribute (so there's no document there).

On Apr 21, 1:32 pm, stony_dreams <amitsau...@gmail.com> wrote:
> I see the same problem. If i read the exception that gets thrown, its
> simply: "Error". Nothing informative.
>
> I just create an iframe dynamically and have an image tag as its child
> node in case iframes are blocked on the browser, but it wont let me
> append.
>
> Any ideas?
>
> On Mar 12, 12:57 pm, Blaine <bla...@worldweb.com> wrote:
>
> > Hi,
>
> > When I try toappendand element to aniframebody it does not work inIE. 
> > However, it works fine in FF.
>
> > Below is a simplified example of the issue. As you can see, using the
> > same element reference (iBody) I can acess the .html() function.
> > Howeverappend, blowup.. Any ideas?
>
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> > <html xmlns="http://www.w3.org/1999/xhtml";>
> > <head>
> > <meta http-equiv="Content-Type" content="text/html;
> > charset=iso-8859-1" />
> > <title>Untitled Document</title>
> > <script language="JavaScript" src="http://ajax.googleapis.com/ajax/
> > libs/jquery/1.2.6/jquery.min.js" type="text/javascript">
> >         google.load("jquery", "1.2.6");
> > </script>
>
> > <script language="JavaScript" type="text/javascript">
> > $(document).ready( function(){
> >         // Grab the pointer toiframebody element
> >         var iBody  = $("#testFrame").contents().find("body");
> >         // Put some text in theiFramebody element to prove we have
> > the right thing.
> >         $(iBody).html("Loaded");
>
> >         //Create an element toappend(much simplified)
> >         var ol = $("<ol><li>test</li></ol>");
> >         //Appendblowing up inIEnot FF
> >         $(iBody).append( ol );
>
> > });
>
> > </script>
> > </head>
>
> > <body>
>
> > <iframe id="testFrame" width="300" height="300"></iframe>
>
> > </body>
> > </html>

Reply via email to