IE9 window.location.href错误 [英] IE9 window.location.href error

查看:153
本文介绍了IE9 window.location.href错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的asp页面中,我使用了以下javascript代码来重定向url.此代码在本机IE7,IE8,Chrome,FireFox和IE9兼容模式下效果很好,但在IE9中不起作用.在使用IE9时,第一次可以正常运行,但下次显示"404-找不到文件或目录.您正在寻找的资源可能已被删除,名称更改或暂时不可用".错误.

In my asp page, I have used the following javascript code for redirecting url.This code works well in native IE7, IE8, Chrome, FireFox and IE9 compatibility mode but not in IE9. While using IE9, first time it works fine but next time shows "404 - File or directory not found.The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable" error.

window.location.href='<%=strURL%>'

要了解我的意思,请打开 http://www.sportsmanager.us/dudleysoccer.htm与IE9 然后在左侧菜单上向下滚动,直到看到U10-DUBEY,U10-SALONIS或任何下面的按钮,然后单击其中之一,并显示计划,但单击另一个按钮时,您将得到404-文件或目录错误.请让我是什么问题. 谢谢,拉维

To know what I mean please open http://www.sportsmanager.us/dudleysoccer.htm with IE9 and on the left side menu, scroll down until you see the U10- DUBEY, U10 - SALONIS or any below button and click one of them and the schedule displays but when click another button you will get 404 - File or directory error.Please let me what is issue. Thanks, Ravi

推荐答案

此解决方案在大多数情况下效果更好:

This solution works better in most of the cases:

window.location.assign('url');

这篇关于IE9 window.location.href错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆