发布于 2016-12-27 07:44:00 | 136 次阅读 | 评论: 0 | 来源: 网友投递
Firebug 网页调试工具
Firebug是网页浏览器 Mozilla Firefox 下的一款开发类插件,现属于Firefox的五星级强力推荐插件之一。它集HTML查看和编辑、Javascript控制台、网络状况监视器于一体,是开发JavaScript、CSS、HTML和Ajax的得力助手。
var obj = {length:0,splice:function(){}}
console.log(obj)
var push = Array.prototype.push;
var splice = Array.prototype.splice;
var a = function() {
var a = function(name) {
return new a.fn.init(name)
}
a.fn = a.prototype;
a.fn.init = function(name) {
var arr = document.getElementsByTagName(name);
merge(this,arr);
}
a.fn.splice = splice;
a.fn.init.prototype = a.fn;
return a;
}()
function merge(first, second) {//完全抄袭jquery中的merge方法- -
var i = first.length || 0, j = 0;
if( typeof second.length === "number") {
for(var l = second.length; j < l; j++) {
first[i++] = second[j];
}
} else {
while(second[j] !== undefined) {
first[i++] = second[j++];
}
}
first.length = i;
return first;
}
a.fn.css = function(pop, val) {
for(var i = 0; i < this.length; i++) {
if(this[i].nodeType===1){
this[i].style[pop] = val;
}
}
return this;
}
var ab = a('div');
ab.css('backgroundColor', '#444444').css('borderWidth', '2px').css('borderStyle', 'solid')