上一页 1 ··· 59 60 61 62 63 64 65 66 67 ··· 77 下一页
摘要: DOM节点类型,在遍历处理中非常有用,可以过滤掉不关心的节点。 如: function showPageAttr(){ var divImgShowArea = document.getElementById('divImgShowArea'); var nodes = divImgShowArea 阅读全文
posted @ 2011-09-30 11:20 hongweigg 阅读(16) 评论(0) 推荐(0)
摘要: 这里要说明的是,公有属性(使用this.修饰符)可以被覆盖,私有属性(使用var 修饰符)不能被覆盖 子类不能访问父类的私有属性,父类的方法正常访问父类的私有变量。 function Vegetable(){ this.taste='delicious'; var a = 'I\'m Vegetab 阅读全文
posted @ 2011-09-29 17:59 hongweigg 阅读(3) 评论(0) 推荐(0)
摘要: 使用prototype特性,可以很方便的在子类中继承父类的方法和属性。 下例中Vegetable视为父类,Celery视为子类。 Vegetable 拥有属性taste, 方法fun1 Celery 拥有属性 color, 方法fun2,如果再定义与Vegetable 中同名的属性或方法,则会覆盖父 阅读全文
posted @ 2011-09-29 11:49 hongweigg 阅读(12) 评论(0) 推荐(0)
摘要: 1. js中undefined,null,NaN的区别 js中undefined,null,NaN的区别 类型分析: js中的数据类型有undefined,boolean,number,string,object等5种,前4种为原始类型,第5种为引用类型。 var a1; var a2 = true 阅读全文
posted @ 2011-09-28 17:07 hongweigg 阅读(8) 评论(0) 推荐(0)
摘要: prototype 可以定义一个对象或称类的方法和属性,下面的例子实现了类似的面向对象编程的方法和属性的设置 function Test1(){ alert('test1 init'); this.p = 'Test1\' property-p'; } Test1.prototype.f = fun 阅读全文
posted @ 2011-09-28 17:02 hongweigg 阅读(8) 评论(0) 推荐(0)
摘要: 返回函数的调用者 function test1(){ if(test1.caller == test2){ alert('test2 call me!'); }else if(test1.caller == test3){ alert('test3 call me!'); }else{ alert( 阅读全文
posted @ 2011-09-28 16:41 hongweigg 阅读(5) 评论(0) 推荐(0)
摘要: js的call方法_apply方法_caller属性_callee属性 原文地址:http://aweber.blogbus.com/logs/46751586.html 一、call 方法 调用一个对象的一个方法,以另一个对象替换当前对象(其实就是更改对象的内部指针,即改变对象的this指向的内容 阅读全文
posted @ 2011-09-28 16:14 hongweigg 阅读(11) 评论(0) 推荐(0)
摘要: call 能实现类似的面向对象继承: function Person(){ this.a = 'person'; this.b = function(){ alert('I\'m a person!'); } this.c = 'Person\' c property'; this.d = func 阅读全文
posted @ 2011-09-28 15:57 hongweigg 阅读(9) 评论(0) 推荐(0)
摘要: apply 方法很强大,可以用来实现类似面向对象编程的特性。 实现继承: function Person(){ this.a = 'person'; this.b = function(){ alert('I\'m a person!'); } } function Student(){ Perso 阅读全文
posted @ 2011-09-28 15:07 hongweigg 阅读(8) 评论(0) 推荐(0)
摘要: _desktop.ini经常被用来伪装威金病毒,一个个删除太麻烦,下面有一个快捷的删除方法: 如删除C,D,E盘的_desktop.ini文件的命令如下: del c:\_desktop.ini /f/s/q/a del d:\_desktop.ini /f/s/q/a del e:\_deskto 阅读全文
posted @ 2011-09-28 10:34 hongweigg 阅读(13) 评论(0) 推荐(0)
上一页 1 ··· 59 60 61 62 63 64 65 66 67 ··· 77 下一页