Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#3031 closed bug (duplicate)

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 :)

Change History (2)

comment:1 Changed 12 years ago by bgrinstead

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

comment:2 Changed 12 years ago by flesler

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.