// !context.createElement fails in IEIE with an error but returns typeof 'object' if ( typeof context.createElement === "undefined" ) //確保context為文件物件 context = context.ownerDocument.ownp. context[0].ownerDocument || document;
// If a single string is passed in and it's a single tag // just do a createElement and skip the rest // just do a createElement and skip the rest //我們大概可能是在外面這樣呼叫它$(this).append("
") //這時就直接把它裡面的元素名取出來,用document.createElement("div")創建後放進數組返回 if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { var match = /^$/.exec(elems[0]); if ( match ) return [ context.createElement( match[1] ); 🎜> } //利用一個div的innerHTML創建一個眾節點 var ret = [], scripts = [], div = context.createElement("div"); //如果我們在外面這樣加$(this).append("
表格1
","
表格1
","
表格1
") / /jQuery.each按它的第四種支分方式(沒有參數,有length)遍歷aguments對象,callback.call( value, i, value ) jQuery.each(elems, function(i, elem){ //i為索引,elem為arguments物件裡的元素 if ( typeof elem === "number" ) elem = '';
elem = '';
elem = '';
// Convert html string into DOM nodes if ( typeof elem === "string" ) { elem.replace(/(]*?)/>/g, function(all, front, tag){ return tag.match(/^(abbr|br|col|img|br|col|img| input|link|meta|param|hr|area|embed)$/i) ? all : );
// Trim whitespace, otherwise indexOf won't work as expected var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase();
var wrap = // option or optgroup !tags.indexOf(" [ 1, "" ] ||