zoukankan      html  css  js  c++  java
  • window.location.href 失效的解决办法

    第一种:在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='';"   Apple-converted-space"> font-family:times new roman">
  • 相关阅读:
    vue cli
    vue element-ui
    vue mint-ui
    vue富文本编辑器
    vue-单文件组件相关
    axios
    vue Router
    css 行内元素和块级元素的一些注意事项
    golang协程和变量
    Internet地址介绍
  • 原文地址:https://www.cnblogs.com/dachuang/p/4475743.html
Copyright © 2011-2022 走看看