2013-10-02 24 views
1

现在,在你开始告诉我不要支持IE6之前,只要知道这不是我的决定,我坚持使用遗留系统强制我向下到ie6,并在可能的时候将ie8 ..我甚至无法提供FF或Chrome,悲伤的日子!在IE6中使用Jquery无法正常工作克隆1.10

我的问题来自一个事实,即特定的机器设置(通过Citrix元框架的IE6)无法克隆元素。

例如:

//clone the elements 
var oldProd = $(this).parents('.wdm-ui-prodHierarchy-fieldset'); 
var newProd = $(this).parents('.wdm-ui-prodHierarchy-fieldset').clone(false); 

//Change the ids in the cloned items 
prodStructSequence++; 
$('#console').append('<p>old prod number: ' + oldProd.attr('number') + '</p>'); 
newProd.attr('number', prodStructSequence); 
$('#console').append('<p>old prod number: ' + oldProd.attr('number') + '</p>'); 
$('#console').append('<p>new prod number: ' + newProd.attr('number') + '</p>'); 
newProd.find('select.prod-struct-service').each(function(i){ this.id = increment(this.id, prodStructSequence); }); 
newProd.find('select.prod-struct-product').each(function(i){ this.id = increment(this.id, prodStructSequence); }); 
newProd.find('select.prod-struct-action').each(function(i){ this.id = increment(this.id, prodStructSequence); }); 
newProd.find('.cloneButton').each(function(i){ this.number = increment(this.number, prodStructSequence); }); 
newProd.find('.removeButton').each(function(i){ this.number = increment(this.number, prodStructSequence); }); 

我也试过直接使用:

newProd.number = prodStructSequence; 

但我的结果总是这样:

old prod number: 1 
old prod number: 2 
new prod number: 2 
Found element.number: 2 
Found element.number: 2 

你有一个解决方案,可能不使用克隆,我只是想让这个工作转向别的东西。

版本:

  1. IE6.0.3790.3959 +思杰+ jQuery的1.10.2不工作
  2. IE6.0.2900.5512 + Windows XP模式SP3 + jQuery的1.10.2工作
  3. IE8,FF, Chrome的各项工作
+3

@ user2751288我觉得他在问题上已经够清楚了,因为这是毫无意义的评论。 – Archer

+0

没有标记很难确定什么可以或不可以帮助,除非当然在这里“古代浏览器的废物”的特定领域的一些专家!您正在克隆的元素是否有ID?我们能否看到它的标记? – Archer

+0

对不起弓箭手没有看到它 – user2751288

回答

0

我最终重写了大部分代码,因为没有任何工作。最终的结果是,我预先生成了X行而不是克隆,并显示/隐藏了组/行,只是按需重置它们。

谢谢大家的建议

0

我没有太多的经验与clone(),但有可能是一个不同的方式来实现这一目标:

$(this).parents('.wdm-ui-prodHierarchy-fieldset').wrap('<span class="save_me_for_later" />'); 

var newProd = $('.save_me_for_later').html(); 

$('.save_me_for_later').remove(); 
+0

明天我会作为最后的手段来看看,谢谢 –