一大早发现,ie6下点发起对话没法弹出窗口,ff浏览器就是可以的。开启HttpWatch检测,发现点击的被aborted。
查找资料显示aborted的原因如下。
The (Aborted) value is more complex in its origin. It occurs when IE has started to process the request for a URL (e.g. to download an image), but then decides to cancel the operation. Here are some examples of when this can occur:
- If you click on a link or bookmark while a page is downloading, or click on IE’s Stop button, you will see that IE cancels any requests which are still active and HttpWatch shows the (Aborted) result.
- A CSS rollover image on a page will start a request when the mouse pointer is moved into its active area. If the mouse pointer quickly moves away again, IE may abort the request if it has not already completed.
- Sometimes javascript is used to fire off requests for background tasks or to gather statistics on a page. Often this can lead to aborted results if the javascript does not wait for the response to be received from the server.
继续寻找根源,搜索到发现这个问题是ie6中一个底层 机制的bug,之后的版本已经解决了。据说<a href="javascript:void(0)">或者<a href=#">这样使用a标签的话并不能阻止a标签最后触发一个什么行为,导致ie6会错误的认为页面刷新或者重定向了,并且中断了当前所有连 接,这样新的加载就被aborted了。解决方案最简单的方法有两个,一个是这样使用a标签<a href="xxx(); return false;">,另外一个就是用div替换a标签来用。至此,问题总算解决。
在开发中常使用<a>标签代替button,好处在于可以利用a:hover样式做mouseover效果,但下面的代码在IE6下就有问题,onclick中的请求被aborted。
<a href="javascript:void(0);" onclick="$('current').src='images/001.jpg';">切换图片</a>,IE6下图片不显示。
<a href="javascript:void(0);" onclick="MyJrjRelation.checkAttention();">关注此人</a>,IE6下请求失败。
解决方法:
1. 不使用onclick,但必须保证处理函数不返回值,否则浏览器将清空页面,只显示函数的结果。如果checkAttention返回false,浏览器中就会显示false。
<a href="javascript:MyJrjRelation.checkAttention();">关注此人</a>
<a href="javascript:void(MyJrjRelation.checkAttention());">关注此人</a> void返回undefined;
2. 在onclick上加return false阻止浏览器执行href。href属性还是必须的,否则链接就样式失效了。
<a href="javascript:void(0);" onclick="MyJrjRelation.checkAttention();return false;">关注此人</a>
总结来说<a href="javascript:void(0);" onclick="MyJrjRelation.checkAttention();return false;">的兼容性最好。
相关知识链接:
http://www.cnblogs.com/zhyt1985/archive/2009/05/27/1490755.html
http://weizuqing1986-126-com.javaeye.com/blog/458141
http://blog.csdn.net/wangjj_016/archive/2010/02/10/5304784.aspx
还有解决办法
比如
$(’#changesite-panel a.city’).click(function(ev){
ev.preventDefault();
changeSite($(this).attr(’rel’));
});
转载的。。。。记录下来,以后用。
<script type="text/javascript"></script>
分享到:
相关推荐
给a标签绑定了一个click事件用来触发ajax请求,在IE6中,请求时常会被中断,在其他浏览器中都一切正常,具体解决方法如下,感兴趣的朋友可以参考下
message:自动真机调试 Error: Aborted. Please retry appid: wxcc22649cfe0db7b5 openid: o6zAJs9SgDdvm3T5BkTODqbUIJB4 ideVersion: 1.06.2401020 osType: win32-x64 time: 2024-02-07 23:12:31
本文主要给大家介绍的是关于MySQL中Aborted告警的相关内容,分享出来供大家参考学习,下面来一起看看详细的介绍: 实战 Part1:写在最前 在MySQL的error log中,我们会经常性看到一些各类的Aborted connection错误,...
在FireFox下编写事件处理函数是很麻烦的事. 因为FireFox并没有 window.event . 如果要得到 event 对象,就必须要声明时间处理函数的第一个参数为event. 所以为了兼容IE与FireFox,一般的事件处理方法为: btn....
在IE8 之前的版本中,存在一个相对于其他浏览器而言,最令人迷惑、讨厌,也最难于调试的错误:操作终止(operation aborted)。在修改尚未加载完成的页面时,就会发生操作终止错误。发生错误时,会出现一个模态对话框...
首先我们来了解下Aborted_clients和Aborted_connects这两个状态变量的含义,当出现会话异常退出时,这两个状态值会有变化。根据官方文档描述,总结如下: 造成Aborted_connects状态变量增加的可能原因: 客户端...
现在用的最多的可能就是formidable了,你知道了它有个progress事件,于是心中大喜,低版本IE的进度条有戏了;OK,试一下: form .on('error',function(err){ console.log(err); }) .on('aborted',function(){ ...
Python is a dynamic programming language, which is completely enterprise ready, owing largely to the variety of support modules that are available to extend its capabilities. In order to build ...
NULL 博文链接:https://k19421.iteye.com/blog/2308526
主要介绍了mysql Sort aborted: Out of sort memory, consider increasing server sort buffer size的解决方法,需要的朋友可以参考下
最近联调ARM+FPGA,不经意间遇到好多JLINK的问题。。
TransactionDemo
https://blog.csdn.net/whoo/article/details/8571550 优化pxe网启动时tftp的传输速度, 感谢博主的分享. pxelinux.0 的blocksize为16k tftp在1000M网络下载可以飞快. 方便大家下载.
1)通过新创建的Image, 经测试会发送一个Aborted的请求,并且IE6不支持, 将new Image改成document.createElement(‘IMG’)也是一样的;测试应该不喜欢这个方案; 代码如下:function getAbsoluteUrl(url){ var img = ...
C# 通过 Renci.SshNet 实现SFTP数据传输(上传、下载、删除、移动等) 开发环境:VS2012
在一个aspx页面中使用了JQuery,但当IE6浏览器打开这个页面的时候会报“Internet Explorer cannot open the Internet site http://localhost:9001/Index.aspx. Operation aborted”的错误,然后就不能正常浏览此页面...
ubuntU14.04下编译运行fast rcnn和各种问题解决