2012年6月4日
摘要: Getting Started with AndroidThis guide describes how to set up your development environment for Cordova and run a sample application. Note that Cordova used to be called PhoneGap, so some of the sites still use the old PhoneGap name.1. RequirementsEclipse 3.4+2. Install SDK + CordovaDownload and ins 阅读全文
posted @ 2012-06-04 14:40 lee0oo0 阅读(2417) 评论(1) 推荐(0) 编辑
摘要: 注意:变量声明后是浏览器关闭才释放,在没关闭之前可以随时使用。function Circle(radius){//r是实例属性,定义并初始化在构造函数中this.r = radius; }//Circle.PI是类属性Circle.PI = 3.14159;//这是一个实例方法Circle.prototype.area = function(){return Circle.PI * this.r * this.r; }//这是类方法Circle.MAX = function(a,b){if(a.r>b.r)return a;elsereturn b; }var c = new Circl 阅读全文
posted @ 2012-06-04 11:45 lee0oo0 阅读(460) 评论(0) 推荐(0) 编辑
摘要: 调用时函数名加上()代表调用这个函数,不加()表示代表这个函数的内容。可以自定义自己的构造函数,只需要编写一个为this添加属性的函数就可以。直接用例子说明:var width; var height;function Rectangle(w,h){this.width = w;//this关键字必须有this.height = h; }//this关键字必须有var rect = new Rectangle(3,2);//创建实例alert(rect.width);//调用原型对象是放置方法和其他不变属性的理想地方。所有的函数都有一个prototype属性,当这个函数被定义的时候,proto 阅读全文
posted @ 2012-06-04 10:19 lee0oo0 阅读(207) 评论(0) 推荐(0) 编辑