摘要:
var div = document.getElementById('div1'); div.style.width = '100px'; div.style.height = '100px'; div.style.backgroundColor = 'red'; div.style.positio 阅读全文
摘要:
var obj = { "2": "a", "3": "b", "length": 2, "push": Array.prototype.push } //属性要为索引(数字)属性,必须有length属性,最好加上push //push 相当于这样 // Array.prototype.push = 阅读全文
摘要:
Array.prototype.unique = function() { var temp = {}, result = [], len = this.length; for (var i = 0; i < len; i ++) { if(!temp[this[i]]) { temp[this[i 阅读全文
摘要:
function typeOf(value) { var ret = typeof(value); var template = { "[object Array]": "array", "[object Object]": "object", "[object Number]": "number 阅读全文