Skip to main content

Bug Tracker

Side navigation

#3031 closed bug (duplicate)

Opened June 12, 2008 04:20PM UTC

Closed June 12, 2008 10:48PM UTC

Last modified March 15, 2012 05:00PM UTC

Clone with IE6 inside of an iframe

Reported by: bgrinstead Owned by:
Priority: major Milestone: 1.3
Component: core Version: 1.2.6
Keywords: iframe clone IE Cc:
Blocked by: Blocking:
Description

I noticed that the clone method would throw an error when I tried to clone an element with a different ownerDocument (such as an iframe) in IE6. After running the code through a debugger, I see that inside the clone method, it needs to pass the new container's owner document through to the clean event.

return jQuery.clean([container.innerHTML], container.ownerDocument)[0];

instead of

return jQuery.clean([container.innerHTML])[0];

This seems to fix the problem. You can replicate it by having an iframe with a dom element inside of it, then calling jQuery("#myElement").clone(). Works fine in firefox, but in IE, you get an invalid argument error. My suggested change fixes this problem.

Sorry if this is the wrong place to put this, but I am new to open source software and didn't feel comfortable (or know how) to make an official patch or whatever. There doesn't seem to be any good tutorials on how to do this on the jQuery site, but if I am missing such a thing, please feel free to let me know :)

Attachments (0)
Change History (2)

Changed June 12, 2008 04:41PM UTC by bgrinstead comment:1

This is a duplicate. See ticket #2997 for same bug.

Changed June 12, 2008 10:48PM UTC by flesler comment:2

resolution: → duplicate
status: newclosed