js中的頁面跳轉相當于jsp中的重定向:
window.location.href = “xxx.jsp”;
但有時window.location.href 有時會失效..這又是萬惡的IE的BUG.以下是解決的方法:
微軟上公布3個解決方案的.
原文地址:http://support.microsoft.com/kb/190244/en-us
第一種:
在window.location.href 后面加上 window.event.returnValue = false;
如:
<a href="#" onclick="window.location.; window.event.returnValue=false;">
第二種:
把window.location.href寫成 javaScript:window.location.href
如:
<a href="Javascript:window.location.>
第三種:
不寫 href 直接寫onlick .然后通過CSS樣式來控制鼠標移上去顯示手型效果.
如:
<a onclick="window.location. onmouSEOver="window.status='http://www.microsoft.com';" onmouseout="window.status='';" style="cursor:pointer; text-decoration:underline; color:blue; font-family:times new roman">參考:http://blog.sina.com.cn/s/blog_49ca87fc0100xvvf.html
新聞熱點
疑難解答