导航

2012年9月19日

摘要: 页面无刷新修改url.便于ajax页面定位。window.location.href;//"http://www.cnblogs.com/surealland/admin/EditPosts.aspx?opt=1";window.location.hash='#test';window.location.href;//"http://www.cnblogs.com/surealland/admin/EditPosts.aspx?opt=1#test"场景:例如页面加载时,判断window.location.hash定位到上次浏览的位置。( 阅读全文

posted @ 2012-09-19 16:36 surealland 阅读(630) 评论(0) 推荐(0) 编辑

摘要: //基本用法function A(){ this.name='A'; this.func=function(x,y){ console.log(this.name,x+y); }}function B(){ this.name='B';}var a=new A();var b=new B();//b调用a的func.a.func.call(b,5,6);//B 11a.func.apply(b,[5,6]);//B 11//升级用法 B“继承”Afunction A(name){ this.a='a'; this.name=na... 阅读全文

posted @ 2012-09-19 16:11 surealland 阅读(134) 评论(0) 推荐(0) 编辑