上一页 1 ··· 4 5 6 7 8 9 下一页
  2012年9月27日
摘要: 原型对象也是普通的对象,并且也有可能有自己的原型,如果一个原型对象的原型不为null的话,我们就称之为原型链(prototype chain)。ECMAScript没有类的概念。但是,重用[reuse]这个理念没什么不同(某些方面,甚至比class-更加灵活),可以由prototype chain原型链来实现。这种继承被称为delegation based inheritance-基于继承的委托,或者更通俗一些,叫做原型继承。构造函数(Constructor)除了创建对象,构造函数(constructor) 还做了另一件有用的事情—自动为创建的新对象设置了原型对象(prototype obje 阅读全文
posted @ 2012-09-27 20:26 冲锋的路上的兵 阅读(249) 评论(0) 推荐(0) 编辑
  2012年9月23日
摘要: defaultView 是直到ie9才出现的Dom下新的方法。在此前parentWindow()有相似功能。document.defaultView()返回当前窗口对象包含的document例子:http://help.dottoro.com/ljvftsxk.phpdocument.defaultView.getComputedStyle(element,[pseudoElt]) 是返回当前“element”的css的所有值(数组)。element 当前文档任何标签[pseudoElt] 可以为null。var style = document.defaultView.getComputed 阅读全文
posted @ 2012-09-23 20:26 冲锋的路上的兵 阅读(3080) 评论(0) 推荐(0) 编辑
  2012年9月16日
摘要: var BaseCalculator = function() { this.decimalDigits = 2;};BaseCalculator.prototype = { add: function(x, y) { return x + y; }, subtract: function(x, y) { return x - y; }};var Calculator = function () { //为每个实例都声明一个税收数字 this.tax = 5;}; Calculator.prototype = ... 阅读全文
posted @ 2012-09-16 09:57 冲锋的路上的兵 阅读(248) 评论(0) 推荐(0) 编辑
  2012年9月15日
摘要: Module模式:var blogModule = (function () { var my = {}, privateName = "博客园"; function privateAddTopic(data) { // 这里是内部处理代码 } my.Name = privateName; my.AddTopic = function (data) { privateAddTopic(data); }; return my;} ());上面的代码声明了一个全局变量blogModule,并且带有2个可访问的属性:blogMod... 阅读全文
posted @ 2012-09-15 10:38 冲锋的路上的兵 阅读(284) 评论(0) 推荐(0) 编辑
  2012年9月14日
摘要: 变量声明: var a, b;任何变量声明不要忘记“var”;for循环: for (var i = 0, max = myarray.length; i < max; i++) { // 使用myarray[i]做点什么 } 减少myarray.length的遍历。命名规范: 对于构造函数,可以使用大驼峰式命名法(upper camel case),如MyConstructor()。对于函数和方法名称,你可以使用小驼峰式命名法(lower camel case),像 是myFunction()。 对于变量,开发者通常使用小驼峰式命名法,但还有另外一种... 阅读全文
posted @ 2012-09-14 21:22 冲锋的路上的兵 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 1.包括主要的大类: (1)Global 全局设置 (2)Transition 暂时理解成位置的变换,跟Animation有相似之处。 (3)Type (确定数据类型,一种类型转变成另一种实用工具)像是内部数据的封装类 (4)Canvas canvas各种操作封装类 (5)Tween 是动画的一种吧。(Android 里也有这个tween和frame动画) (6)Transform (还未深究) (7)Animation 动画 (8)Node (可能是对canva内部节点(线,矩形,图像等)的操作) (9)Container 容器,包含node... 阅读全文
posted @ 2012-09-14 19:19 冲锋的路上的兵 阅读(373) 评论(0) 推荐(0) 编辑
  2012年9月12日
摘要: IDL通过一种中立的方式来描述接口,使得在不同平台上运行的对象和用不同语言编写的程序可以相互通信交流;比如,一个组件用C++写成,另一个组件用Java写成。IDL建立起了两个不同操作系统间通信的桥梁。Android Interface Definition Language(AIDL)It allows you to define the programming interface that both the client and service agree upon in order to communicate with each other using interprocess comm 阅读全文
posted @ 2012-09-12 19:27 冲锋的路上的兵 阅读(2082) 评论(0) 推荐(0) 编辑
  2012年7月16日
摘要: httpbase = "http://localhost:7070/http-bind/"; 对应oArgs.domain = "localhost";httpbase = "http://ip:7070/http-bind/"; 对应oArgs.domain = "ip";httpbase = "http://127.0.0.1:7070/http-bind/"; 对应oArgs.domain = "127.0.0.1";本地apache好像支持ie , firefox g 阅读全文
posted @ 2012-07-16 20:39 冲锋的路上的兵 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 直接用removeChild删除元素好像有bug故要找到其父节点 然后删除此节点var div = document.getElementById("XX");div.parentNode.removeChild(div); 阅读全文
posted @ 2012-07-16 20:34 冲锋的路上的兵 阅读(713) 评论(0) 推荐(0) 编辑
  2012年7月10日
摘要: function doclick(e) { //var td = event.srcElement; // 通过event.srcElement 获取激活事件的对象 td //alert("行号:" + (td.parentElement.rowIndex + 1) + ",内容:" + td.innerText); //可惜firefox不支持 e = window.event || e; srcE... 阅读全文
posted @ 2012-07-10 16:37 冲锋的路上的兵 阅读(846) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页