IE9 window.location.href error

陌路散爱 提交于 2019-12-08 11:35:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!