Bug Tracker

Modify

Ticket #3031 (closed bug: duplicate)

Opened 5 years ago

Last modified 15 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 5 years ago by bgrinstead

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

comment:2 Changed 5 years ago by flesler

  • Status changed from new to closed
  • Resolution set to duplicate

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.