OpenLayers OpenLayers

Ticket #842: onabort.html

File onabort.html, 0.7 kB (added by ahocevar, 1 year ago)

Simple html page to prove that the onabort event only works in IE. To try, press ESC shortly after saying "ok" to the "start" alert box.

Line 
1 <html>
2   <head>
3     <title></title>
4     <meta content="">
5     <style></style>
6     <script type="text/javascript">
7 function abortme(event) {
8 alert ('abort');
9 }
10 function loaded(event) {
11 alert('loaded');
12 }
13 function start() {
14     var img = document.getElementById('image');
15     alert('start');
16     img.src = "http://farm2.static.flickr.com/1020/1448812926_8abdec1ebe_o_d.jpg";
17     if (img.addEventListener) {
18         img.addEventListener("abort", abortme, false);
19         img.addEventListener("load", loaded, false);
20     } else if (img.attachEvent) {
21         img.attachEvent("onabort", abortme);
22         img.attachEvent("onload", loaded);
23     }
24 }
25     </script>
26   </head>
27 <body onload="start()">
28 <img id="image"></img>
29 </body>
30 </html>