【问题标题】:Cloning not working correctly in IE6 with Jquery 1.10使用 Jquery 1.10 在 IE6 中克隆无法正常工作
【发布时间】:2013-10-02 20:02:38
【问题描述】:

现在,在你开始告诉我不支持 IE6 之前,请知道这不是我的决定,而且我被遗留系统所困,迫使我降级到 ie6,并在可能的情况下降级到 ie8...我什至无法交付 FF或 Chrome,悲伤的日子!

我的问题来自特定机器设置(通过 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 + Citrix + jQuery 1.10.2 不起作用
  2. IE6.0.2900.5512 + Windows Xp Mode SP3 + jQuery 1.10.2 工作
  3. IE8,FF, Chrome 一切正常

【问题讨论】:

  • @user2751288 我认为他的问题已经足够清楚了,以至于这是一个毫无意义的评论。
  • 没有标记很难确定什么可能有帮助或可能没有帮助,除非这里有一些“废话古代浏览器”特定领域的专家!您正在克隆的元素是否有 ID?我们可以看到它的标记吗?
  • 抱歉弓箭手没看到
  • @user2751288 我不能说话。我今天已经完成了我没有彻底阅读的公平份额:p
  • 你试过使用内置的cloneNode()吗?

标签: jquery internet-explorer-6


【解决方案1】:

我对@9​​87654321@ 没有太多经验,但可能有不同的方法来实现这一点:

$(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();

【讨论】:

  • 我明天会在万不得已的情况下对此进行调查,谢谢
【解决方案2】:

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

谢谢大家的建议

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-30
    • 2014-04-04
    • 1970-01-01
    • 2019-01-30
    • 1970-01-01
    • 1970-01-01
    • 2010-12-29
    • 2018-10-18
    相关资源
    最近更新 更多