before()
根據(jù)參數(shù)設(shè)定,在匹配元素的前面插入內(nèi)容:
before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }
類似after只是替換了第二個參數(shù),改變插入的位置。
append()
在每個匹配元素里面的末尾處插入?yún)?shù)內(nèi)容:
append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }
內(nèi)部增加節(jié)點,直接可以調(diào)用appendChild方法。
prepend()
prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); },
類似after只是替換了第二個參數(shù),改變插入的位置。
請驗證,完成請求
由于請求次數(shù)過多,請先驗證,完成再次請求
打開微信掃碼自動綁定
綁定后可得到
使用 Ctrl+D 可將課程添加到書簽
舉報