請大家學習的注意這兩個地方、很容易忽略:
1.上面的方法改掉了TYPE其實就是讓腳本無法解析(不是報錯)、js會忽略
2.上面關(guān)注的正則,是為了兼容XML進行的處理、而上文是在javascript中運行所以替換掉了
OK!
1.上面的方法改掉了TYPE其實就是讓腳本無法解析(不是報錯)、js會忽略
2.上面關(guān)注的正則,是為了兼容XML進行的處理、而上文是在javascript中運行所以替換掉了
OK!
2016-09-25
為大家解釋幾點:
parentEles[0].ownerDocument //就是Document文檔對象
fragment.firstChild //獲取創(chuàng)建成功的DOM、也就是我們需要添加的對象
context.createElement("div") //不要誤解,就是普通的創(chuàng)建一個元素 一般:document.xxx 或者 $(...)
fragment.appendChild() //返回創(chuàng)建的元素,也就是DIV
if (first){callback.call(parentEles, first);} //如果創(chuàng)建成功,寫入文檔
自此:本頁內(nèi)容就是這些!
parentEles[0].ownerDocument //就是Document文檔對象
fragment.firstChild //獲取創(chuàng)建成功的DOM、也就是我們需要添加的對象
context.createElement("div") //不要誤解,就是普通的創(chuàng)建一個元素 一般:document.xxx 或者 $(...)
fragment.appendChild() //返回創(chuàng)建的元素,也就是DIV
if (first){callback.call(parentEles, first);} //如果創(chuàng)建成功,寫入文檔
自此:本頁內(nèi)容就是這些!
2016-09-21
規(guī)避WebKit checked屬性
// We can't cloneNode fragments that contain checked, in WebKit
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) {return this.each(function() {jQuery(this).domManip( args, table, callback, true );});}
// We can't cloneNode fragments that contain checked, in WebKit
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) {return this.each(function() {jQuery(this).domManip( args, table, callback, true );});}
2016-09-20
局部變量初始化
2: var results, first, fragment, parent,
3: value = args[0],
4: scripts = [];
5:
2: var results, first, fragment, parent,
3: value = args[0],
4: scripts = [];
5:
2016-09-20
1. 將args轉(zhuǎn)換為DOM元素,并放在一個文檔碎片中,調(diào)用jQuery.buildFragment和jQuery.clean實現(xiàn)
2. 執(zhí)行callback,將DOM元素作為參數(shù)傳入,由callback執(zhí)行實際的插入操作
2. 執(zhí)行callback,將DOM元素作為參數(shù)傳入,由callback執(zhí)行實際的插入操作
2016-09-20