`
364434006
  • 浏览: 586878 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

ie6中href设为javascript:void(0)页面无法提交

 
阅读更多

<a href="javascript:void(0);" onclick="javascript:window.location.href='http://www.baidu.com'">open Baidu</a>

在主流浏览器都可以正常打开baidu.com,但是在ie6下却没有效果

解决方式:

1.<a href="javascript:void(0);" onclick="javascript:window.location.href='http://www.baidu.com';return false;">open Baidu</a>

2.<a href="#" onclick="javascript:window.location.href='http://www.baidu.com'">open Baidu</a>

3.<a href="###" onclick="javascript:window.location.href='http://www.baidu.com'">open Baidu</a>

第二种方式回返回到页面顶端

分享到:
评论

相关推荐

    jquery 仿QQ相册

    &lt;li&gt;&lt;a title="" href="javascript:void(0);"&gt;&lt;img alt="" src="pics/1.jpg"&gt;&lt;/a&gt; &lt;li&gt;&lt;a title="" href="javascript:void(0);"&gt;&lt;img alt="" src="pics/2.jpg"&gt;&lt;/a&gt; &lt;li&gt;&lt;a title="" href=...

    javascriptvoid(0)含义以及与”#”的区别讲解

    链接(href)直接使用javascript:void(0)在IE中可能会引起一些问题,比如:造成gif动画停止播放等,所以,最安全的办法还是使用“####”。为防止点击链接后跳转到页首,onclick事件return false即可。 3.如果仅仅...

    IE6中ajax aborted错误请求中断解决方法

    但是,在HTML代码中,已经将a标签的href设置成了”[removed]void(0)”,通常这样是可以阻止默认事件了(页面跳转)。a标签的click事件会先执行,然后才执行href的跳转,如果href是一段javascript语句,这个时候就会...

    [removed].href IE下跳转失效的解决方法

    原因可能是因为在href中的[removed]void(0)阻止的事件行为,解决方法如下: 1.在onclick事件中加return false来阻止冒泡: 代码如下: $(“a”).click(function(){ [removed].href = “xxx.html”;

    在JS中a标签加入单击事件屏蔽href跳转页面

    我们常用的在a标签中有点击事件: 1. a href=[removed]js_method(); ...a href=[removed]void(0); onclick=js_method() 这种方法是很多网站最常用的方法,也是最周全的方法,onclick方法负责执行

    asp+ajax静态分页

    document.getElementById('right').innerHTML='&lt;a href="javascript:void(edit())" title="修改每页显示条数"&gt;Edit&lt;/a&gt;'; } function save() { //保存修改后的显示条数 var pagesize=document.getElementById('...

    Asp+AJAX静态分页 亲测 可用

    if (xmlhttp.readyState==4 && xmlhttp.status==200) { //如果xmlhttp.readyState==4并且xmlhttp.status==200时,执行条件中的程序,其中readyState有五个值,4为请求完成,是客户端向服务器提交的数据成功到达,...

    详解a标签添加onclick事件的几种方式

    我们常用的在a标签中有点击事件: 1. a href=”[removed]js_method();” rel=”external nofollow” ...2. a href=”[removed]void(0);” rel=”external nofollow” rel=”external nofollow” onc

    a 中调用js的几种方法整理及使用推荐

    我们常用的在a标签中有点击事件: 1. a href="[removed]js_method();...2. a href="[removed]void(0);" onclick="js_method()" 这种方法是很多网站最常用的方法,也是最周全的方法,onclick方法负责执

    《javaScrip开发技术大全》源代码

    第6章(\代码\第06章) • sample01.htm 先使用后递增 • sample02.htm 先递增后使用 • sample03.htm 先使用后递减 • sample04.htm 先递减后使用 • sample05.htm 字符串...

Global site tag (gtag.js) - Google Analytics