摘要:
#1默认原型继承function inherint(C,P){C.prototype = new P();}function Parent(name){this.name =name||"Adam";}Parent.prototype.say = function(){return this.nam... 阅读全文
摘要:
优点:1.封装私有变量---对于上来就初始化且不让修改的,对于只需执行一次的工作2.变量用于自调用函数不污染全局变量,封装模块提供一个作用域沙箱用于初始化分支var util = { addListener:function(ele,type,handle){ if (typeof window.a... 阅读全文
摘要:
JavaScript跨域总结与解决办法什么是跨域1、document.domain+iframe的设置2、动态创建script3、利用iframe和location.hash4、window.name实现的跨域数据传输5、使用HTML5 postMessage6、利用flash本文来自网络(http... 阅读全文