上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页
摘要: 1) Commands > Bundle Development > Install Bundle > jQuery 2) 重起Aptana Studio. 3) 在工作项目上右击,选择 Properties > Project Build Path 点选jQuery复选框。 若要支持其他js库,请参考https://wiki.appcelerator.org/display/tis/... 阅读全文
posted @ 2011-12-30 10:28 fxair 阅读(2044) 评论(0) 推荐(0) 编辑
摘要: 先看一段简单的代码: var testFun=function (name,age){ var job='Flash Develop'; return new testFun.init(name,age,job);}testFun.init=function(name,age,job){ return 'name:'+name+',age:'+age+',job:'+job+'';}alert(... 阅读全文
posted @ 2011-12-28 10:56 fxair 阅读(168) 评论(0) 推荐(0) 编辑
摘要: JavaScript缺少块级作用域,没有private修饰符,但它具有函数作用域。作用域的好处是内部函数可以访问它们的外部函数的参数和变量(除了this和argument。内部中的函数中的this指向全局对象,argument指向内部函数的函数参数)。我们可以利用这种属性来模拟面向对象中的私有属性。 var myObject=function(value){ var value=value ||... 阅读全文
posted @ 2011-12-27 14:16 fxair 阅读(817) 评论(2) 推荐(0) 编辑
摘要: 遍历出对象的属性可以用for in语句,如: Function.prototype.addMethod=function(methodName,func){ if(!this.prototype[methodName]){ this.prototype[methodName]=func;//给原型增加方法,此方法会影响到该类型的实例上 } return this.prototype;//返回原... 阅读全文
posted @ 2011-12-27 13:24 fxair 阅读(468) 评论(0) 推荐(2) 编辑
摘要: javaScript的类型函数(如Number/String/Boolean/Array/Date/Obejct等)都是继承于 Function.prototype,所以给Function.prototype增加方法,同时也会影响到由它衍生的下层类型函数。如: Function.prototype.addMethod=function(methodName,func){ if(!this[met... 阅读全文
posted @ 2011-12-27 10:40 fxair 阅读(1187) 评论(0) 推荐(2) 编辑
摘要: Object.prototype JavaScript是基于原型继承的,任何对象都有一个prototype属性。Object.prototype是所有对象的根,并且不可改变。 Object.prototype=null;alert(Object.prototype);//[object Object]Object与Object.prototypeObject继承于Object.prototyp... 阅读全文
posted @ 2011-12-26 17:19 fxair 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 在javascript中一共有四种调用模式:方法调用模式、函数调用模式、构造器调用模式和apply调用模式。这些模式在如何初始化关键参数this上存在差异。 方法调用模式 当一个函数被保存为对象的一个属性时,我们称之它为该对象的一个方法,那么this被绑定到该对象上。 var myObject={ name : "myObject" , value : 0 , increment : function(num){ this.value += typeof(num) === 'number' ? num : 0; } , toString : function 阅读全文
posted @ 2011-12-26 14:18 fxair 阅读(426) 评论(0) 推荐(1) 编辑
摘要: 1. Programming Guide 1.1. Prototype是什么? 1.2. 关联文章 1.3. 通用性方法 1.3.1. 使用 $()方法 1.3.2. 使用$F()方法 1.3.3. 使用$A()方法 1.3.4. 使用$H()方法 1.3.5. 使用$R()方法 1.3.6. 使用Try.these()方法 1.4. Ajax 对象 1.4.1. 使用 Aj... 阅读全文
posted @ 2011-12-23 14:45 fxair 阅读(1664) 评论(0) 推荐(0) 编辑
摘要: 最常用语句: console.log("I am Firebug!"); 输出:I am Firebug! console.log 除了可以直接将字符串输出以外,还可以使用如 C 语言的 printf 一样的格式控制进行输出。 var num = 222; console.log("My test num is %d",num); 输出:My test num is 22另外四种调试输出语句:console.debug("I am debug"); console.info("I am info"); consol 阅读全文
posted @ 2011-12-23 10:14 fxair 阅读(307) 评论(0) 推荐(0) 编辑
摘要: metadata就是元数据,反应一个类本质的属性,可以通过describeType(obj)来得到反应该对象的xml.要自定义元数据,如[MyMatedata()]:package{publicclassMyClassextendsObject{[MyMatedata(name="ha",name2="haha2")]publicvara:String;publicfunctionMyClass(){super();}publicfunctiongetA():void{trace("dd");}}}describeType(new M 阅读全文
posted @ 2011-08-26 18:40 fxair 阅读(529) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页