Dotfish

博客园 首页 新随笔 联系 订阅 管理

最近公司项目用到My97DatePicker,点击文本框时本来应该弹出日期选择控件,但是第一次点击时,自动跳转到历史前一页面,于是google,找到一解决办法:

修改My97DatePicker/calendar.js文件,
在function My97DatePicker()方法中
if(navigator.product!='Gecko'){
if(location.href.substring(location.href.length-3).toLowerCase()=='#97'){location.replace(location.href.substring(0,location.href.length-3));
return;}
else{location.replace(location.href+"#97");}
history.go(
-1);}

 

注释history.go(-1)就行了,有点知其然而不知其所以然

posted on 2012-07-13 10:39  Peter Wang  阅读(595)  评论(0编辑  收藏  举报