Skip to main content

Bug Tracker

Side navigation

#5784 closed bug (wontfix)

Opened January 11, 2010 06:36PM UTC

Closed June 13, 2010 11:50PM UTC

IE 6/7 clone tainting URLs

Reported by: georgem Owned by:
Priority: major Milestone:
Component: manipulation Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

This issue was discovered while using the jQuery ConvertTo plugin.

http://plugins.jquery.com/project/convertTo

Looking closely at

var contents = $this.html();
var source = $("<div></div>").append($this.clone(true)).html().replace(contents, "");

Here is the contents of each variable

var contents

<DIV style="WIDTH: 313px; HEIGHT: 157px; OVERFLOW: hidden" id=cta_key_home_cta_1 class=cta wc:delay="5"><A href="/photos/"><IMG alt=home_cta_1 src="/media/ctas/home-cta1_.jpg"></A> 
<DIV class=cta_item hidden="true" wc:link="/photos/" wc:image="/media/ctas/home-cta1_.jpg" wc:swf=""></DIV>
<DIV class=cta_item hidden="true" wc:link="/photos/" wc:image="/media/ctas/home-cta2__.jpg" wc:swf=""></DIV>
<DIV class=cta_item hidden="true" wc:link="/photos/" wc:image="/media/ctas/home-cta3__.jpg" wc:swf=""></DIV></DIV>
<DIV style="WIDTH: 313px; HEIGHT: 157px; OVERFLOW: hidden" id=cta_key_home_cta_2 class=cta wc:delay="5"><A href="/locator/"><IMG alt=home_cta_2 src="/media/ctas/home-cta2_.jpg"></A> 
<DIV class=cta_item hidden="true" wc:link="/locator/" wc:image="/media/ctas/home-cta2_.jpg" wc:swf=""></DIV></DIV>
<DIV style="WIDTH: 313px; HEIGHT: 157px; OVERFLOW: hidden" id=cta_key_home_cta_3 class=cta wc:delay="5"><A href="/blog/"><IMG alt=home_cta_3 src="/media/ctas/home-cta3_.jpg"></A> 
<DIV class=cta_item hidden="true" wc:link="/blog/" wc:image="/media/ctas/home-cta3_.jpg" wc:swf=""></DIV></DIV>

var source

<DIV id=homectas class="container something" cellpadding="0" cellSpacing="0">
<DIV style="WIDTH: 313px; HEIGHT: 157px; OVERFLOW: hidden" id=cta_key_home_cta_1 class=cta wc:delay="5"><A href="http://192.168.1.176:8000/photos/"><IMG alt=home_cta_1 src="http://192.168.1.176:8000/media/ctas/home-cta1_.jpg"></A> 
<DIV class=cta_item hidden="true" wc:link="/photos/" wc:image="/media/ctas/home-cta1_.jpg" wc:swf=""></DIV>
<DIV class=cta_item hidden="true" wc:link="/photos/" wc:image="/media/ctas/home-cta2__.jpg" wc:swf=""></DIV>
<DIV class=cta_item hidden="true" wc:link="/photos/" wc:image="/media/ctas/home-cta3__.jpg" wc:swf=""></DIV></DIV>
<DIV style="WIDTH: 313px; HEIGHT: 157px; OVERFLOW: hidden" id=cta_key_home_cta_2 class=cta wc:delay="5"><A href="http://192.168.1.176:8000/locator/"><IMG alt=home_cta_2 src="http://192.168.1.176:8000/media/ctas/home-cta2_.jpg"></A> 
<DIV class=cta_item hidden="true" wc:link="/locator/" wc:image="/media/ctas/home-cta2_.jpg" wc:swf=""></DIV></DIV>
<DIV style="WIDTH: 313px; HEIGHT: 157px; OVERFLOW: hidden" id=cta_key_home_cta_3 class=cta wc:delay="5"><A href="http://192.168.1.176:8000/blog/"><IMG alt=home_cta_3 src="http://192.168.1.176:8000/media/ctas/home-cta3_.jpg"></A> 
<DIV class=cta_item hidden="true" wc:link="/blog/" wc:image="/media/ctas/home-cta3_.jpg" wc:swf=""></DIV></DIV></DIV>

Looking through the html you can see that all the src and href attributes have changed and now include the full URL. This then breaks the ability to replace not to mention returns unexpected results compared to every other browser.

Attachments (0)
Change History (3)

Changed January 11, 2010 06:41PM UTC by georgem comment:1

var source (Expected result)

<DIV id=homectas class="container something" cellpadding="0" cellSpacing="0"></DIV>

Changed January 14, 2010 01:48AM UTC by dmethvin comment:2

Unfortunately, IE expands the URL when it serializes HTML inside

.clone()
. This issue has been identified before and closed as wontfix because it doesn't have a reasonable solution.

http://github.com/jquery/jquery/blob/master/src/manipulation.js#L149

If you can think of a solution let us know.

Changed June 13, 2010 11:50PM UTC by dmethvin comment:3

component: unfiledmanipulation
resolution: → wontfix
status: newclosed