This method works fine for a single frame document.
If you dynamically create a DOM element on the top frame and trying to
move this element in IE, an error will be thrown.  See this thread:
http://groups.google.com/group/jquery-en/browse_thread/thread/e762d9b9e987b8cd/59e6fc098c757da2?lnk=gst&rnum=1#59e6fc098c757da2

According to Jeff, I can use
var doc = $('#testframe')[0].contentWindow.document;  $
(doc.body).append('<span>test</span>');
to achieve using top's jQuery create element for all child frames.

However, this method does not has the flexibility to get the new
element easily.  The methods suggested so far will not work in IE.

Any other suggestion?  Thanks. I appreciate all the responses.



On Aug 20, 12:21 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> You could do it like this, perhaps:
>
> var $testDiv = $("<div class='testDiv'></div>").appendTo
> (window.document.body);
>
> Is that what you're looking for?
>
> --Karl
> _________________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Aug 20, 2007, at 11:47 AM, Jay W wrote:
>
>
>
>
>
> > With the help from a few jQuery'ers, the only way to dynamically
> > create and append element using jQuery for multiframe application is
>
> > $(window.document.body).append("<div class='testDiv'></div>");
>
> > This jQuery statement returns window.document.body object.
>
> > There will be quite a few elements created this way in a same
> > document, it will be confusing to use array index to retrieve the
> > newly created element. So the question is: if I want to get that newly
> > created object directly, what's the correct way to do it?
>
> > Thanks.- Hide quoted text -
>
> - Show quoted text -

Reply via email to