10 2013 档案

XMLHttpRequest函数
摘要:function createXmlHttpRequest(){ if(window.ActiveXObject){ return new ActiveXObject("Microsoft.XMLHTTP"); }else if(window.XMLHttpRequest){ return new XMLHttpRequest(); } } (function(){ var url = "/ordermgr/a.txt"; xmlHttpRequest = createXmlHttpRequest(); xmlH... 阅读全文

posted @ 2013-10-29 10:08 rainbow661314 阅读(259) 评论(0) 推荐(0)

继承模式
摘要:模式1:默认模式代码复用大家常用的默认模式,往往是有问题的,该模式使用Parent()的构造函数创建一个对象,并且将该对象赋值给Child()的原型。我们看一下代码:function inherit(C, P) { C.prototype = new P();}function Parent(name) { this.name = name || 'Adam';}Parent.prototype.say = function () { return this.name;};function Child(name) {}inherit(Child, Parent);var kid 阅读全文

posted @ 2013-10-23 18:04 rainbow661314 阅读(200) 评论(0) 推荐(0)