解决DotNetTextBox与window.history冲突!

DotNetTextBox是一个很不错的在线编辑工具,我一直在用它。

最近使用中发现它和window的history对象有冲突,原因就是它定义了一个全局的名为history的对象,覆盖默认的window.history。

所以当你想在页面中调用“后退”功能(window.history.go(-1))时会产生脚本错误,找不到对象或方法。

解决方法:

在history对象变量前定义一全局变量引用window.history。如:var History = window.history;

以后如访问“后退”功能可History.go(-1);

其它如有冲突的对象也可用类似方法解决!!

最好的解决办法是在页面前面 

<script type="text/javascript" language="javascript">
var History = window.history;
</script>

 

使用的时候: 

<input id="Button1" class="inputButton" type="button" value=" 返 回 "
onclick
="javascript:History.go(-1);" />
posted @ 2009-12-27 20:08  ycmoon  阅读(341)  评论(0编辑  收藏  举报
QQ:817647 MSN:kenny@msn.cn EMail:ycmoon@qq.com