1
使用jQuery:奇怪的jquery錯誤,使用包裹物後當試圖追加()()
1)創建一個容器
2)與它
3)通過選擇容器包裹的元件傳遞一個對象到jquery選擇器並嘗試添加一個元素到容器中
爲什麼不添加元素?
在這裏看看這個例子:http://jsfiddle.net/Tngh4/
var container = document.createElement("div");
//Wrapping some random element with the container
$("#randomElem").wrap(container);
var elem = document.createElement("div");
//Selecting element this way and using append results in a strange bug
$(container).append(elem);
THX。現在看起來很明顯。我無法相信我錯過了它。 – CoolCodeBro 2013-04-24 19:16:10