• 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">
  • 相关阅读:
    OC面向对象—封装
    OC内存管理
    OC方法和文件编译
    OC语言基础知识
    OC语言前期准备
    C语言指针基础
    C语言字符串
    C语言数组
    C语言内存分析
    C语言函数
  • 原文地址:https://www.cnblogs.com/dachuang/p/4475743.html
Copyright © 2020-2023  润新知