zoukankan      html  css  js  c++  java
  • js中的页面跳转

    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.href='http://www.microsoft.com';
       window.event.returnValue=false;">

    第二种:

    把window.location.href写成 JavaScript:window.location.href

    如:

    <a href="JavaScript:window.location.href='http://www.microsoft.com';">
    

    第三种:

    不写 href 直接写onlick .然后通过css样式来控制鼠标移上去显示手型效果.

    如:

    <a onclick="window.location.href='http://www.microsoft.com';"
       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
  • 相关阅读:
    省选测试29
    省选测试28
    省选测试27
    省选测试26
    省选测试25
    最小费用最大流Dinic
    省选测试24
    省选测试23
    省选测试22
    省选测试21
  • 原文地址:https://www.cnblogs.com/tooker/p/4704370.html
Copyright © 2011-2022 走看看