\n
| OS | Browser | "" | null | remove | delete | stop | StopImage | Stop | Button | Timeout | |\n\n\n\n\n\n\n\n\n\n|\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|\n\n\n\n\n\n\n|\n\n\n\n\n\n\n|\n\n\n\n\n\n\n\n|\n\n\n\n\n\n\n\n|\n\n\n\n\n\n|\n\n\n\n\n\n\n\n\n\n\n|\n\n\n\n\n\n|\n\n\n\n\n\n\n\n|\n\n\n\n\n\n\n\n\n\n\n\n| | Windows | IE6,7,8 | √(e) | √(e) | II | × | × | × | × | × | 21s (e) | | / | FF4,5 | II | II | II | × | II | × | × | II | 21s (e) | | / | Chrome12 | × | × | × | × | II | × | × | II | 21s (e) | | / | Safari4,5 | × | × | × | × | II | × | × | II | 21s (e) | | / | Opera9 | × | √(e) | × | × | II | × | × | II | 47s (e) | | / | Opera11 | II | √(e) | II | II | II | × | × | II | 47s (e) | | Mac OS X | Safari5 | × | × | × | × | II | × | × | II | 1.2m (e) | | / | Chrome12 | × | × | × | × | II | × | × | II | 1.2m (e) | | / | FF4,5 | II | II | II | × | II | × | × | II | 1m'15s (e) | | Ubuntu | FF4,5 | II | II | II | × | II | × | × | | 3m'9s (e) | | / | Chrom(e/ium)12 | × | × | × | × | II | × | × | | 3.2m (e) |
\n Windows XP, Server 2003, 7. \n Mac OS X 10.6.7 \n Ubuntu 11.04
\n标题注解:\n
\n图标注解:\n
测试结果:
为什么不是 script/link?
使用 document.createElement("script") 创建元素并设置 src 属性, appendChild 到 DOM 中会去请求指定资源,可以到底向日志服务器发送数据的要求。
但是使用这种方式有一下几点弊端:
创建脚本带来的危险性。
会向 DOM 中附加元素,影响 DOMLint 校验。
无法 abort,无论设置 script = null;, script.src="";, script.src=null;,
script.removeAttribute("src");, document.body.removeChild(script);
都无法实现 abort.
引入资源不触发 onload/onerror/onabort 事件,除非使用 jsonp 的方式, 对元素本身无法得到回调。
\n https://stackoverflow.com/questions/930237/javascript\ncancel\nstop\nimage\nrequests
\n https://www.sysopt.com/forum/archive/index.php/t\n177147.html
\n https://stackoverflow.com/questions/1671717/javascript\nimage\nonabort\nevent\nnot\nfiring\nin\nfirefox\nchrome
\n https://stackoverflow.com/questions/4506160/abort\nactive\nimage\nrequests
\n https://www.devguru.com/technologies/ecmascript/quickref/image.html
\n Javascript: Cancel/Stop Image Requests
\n Can't you stop images from loading?
\n window.stop()
\n https://stackoverflow.com/questions/930237/javascript\ncancel\nstop\nimage\nrequests
\n https://stackoverflow.com/questions/3146200/stop\nloading\nof\nimages\non\na\nhashchange\nevent\nvia\njavascript\nor\njquery
\n https://developer.mozilla.org/en/DOM/window.stop
\n execCommand
\n execCommand Method
\n https://msdn.microsoft.com/en\nus/library/ms536419%28v=vs.85%29.aspx
\n https://msdn.microsoft.com/en\nus/library/ms533049%28v=vs.85%29.aspx
\n https://developer.mozilla.org/En/Document.execCommand
\n IE6下链接ONCLICK事件处理中的请求被ABORTED
\n What does (Aborted) mean in HttpWatch?
来源
\n https://blog.httpwatch.com/2007/11/20/error\ninternet\ninvalid\nurl\nhttpwatch/
\n HttpWatch工具简介及使用技巧