javascript.js (593B)
1 /** 2 sample javascript from xui 3 */ 4 5 var undefined, 6 xui, 7 window = this, 8 string = new String('string'), 9 document = window.document, 10 simpleExpr = /^#?([\w-]+)$/, 11 idExpr = /^#/, 12 tagExpr = /<([\w:]+)/, 13 slice = function (e) { return [].slice.call(e, 0); }; 14 try { var a = slice(document.documentElement.childNodes)[0].nodeType; } 15 catch(e){ slice = function (e) { var ret=[]; for (var i=0; e[i]; i++) 16 ret.push(e[i]); return ret; }; } 17 18 window.x$ = window.xui = xui = function(q, context) { 19 return new xui.fn.find(q, context); 20 };