IE9 window.location.href error
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%>'
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
这种解决方案在大多数情况下效果更好:
window.location.assign('url');
对于IE9:
window.location = "<%=strURL%>";
Try using window.open(url)
instead of location. This solved my problem with long urls perhaps it will help you here
上一篇: 用htaccess删除尾部问号