gpt4 book ai didi

javascript - 未捕获的 NotFoundError : An attempt was made to reference a Node in a context where it does not exist

转载 作者:行者123 更新时间:2023-11-30 10:25:53 25 4
gpt4 key购买 nike

无法真正描述为什么这不起作用。

我确实有 JS 对象控制一些数据,每个控件也有一个 HTML 对象。该对象存储在数组中。我在很多项目中都这样做过几次,但现在在使用 jQuery 的“wrapAll”时出现错误。

这是 jsfiddle,这应该是最好的描述:http://bit.ly/17ilvDe

拜托:我不知道发生了什么,帮帮我:)

感谢阅读,感谢每一个回复。

最佳答案

您不能使用这样的数组创建 jQuery 对象...一种可能的解决方案是

var elements = $();
$(items).each(function(){
elements = elements.add(this.Item);
});
elements.wrapAll("<div class='subpage' />");

演示:Fiddle

关于javascript - 未捕获的 NotFoundError : An attempt was made to reference a Node in a context where it does not exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19586472/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com