问题
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
回答1:
This solution works better in most of the cases:
window.location.assign('url');
回答2:
For IE9:
window.location = "<%=strURL%>";
回答3:
Try using window.open(url)
instead of location. This solved my problem with long urls perhaps it will help you here
回答4:
I had a similar problem, but it went away when I closed and reopened IE9.
来源:https://stackoverflow.com/questions/7690645/ie9-window-location-href-error