JSFiddle - React, Tailwind, and code Playground
by neilime
HTML
<h1>Try to download java</h1>
<a href="http://javadl.sun.com/webapps/download/AutoDL?BundleId=58143" class="hyperlink1 notloading">open it 1</a>
<a href="http://javadl.sun.com/webapps/download/AutoDL?BundleId=58143" class="hyperlink2 notloading">open it 2</a>
JavaScript
//Hyperlink1 works because it show the popup to save the exe, but there's no events to know when the request is loaded
$$('.hyperlink1')[0].addEvents({
'click':function(){
console.log('hyperlink1 start loading');
},
//This event doesnt exist but i'm looking for an equivalent
'load':function(){
console.log('hyperlink1 stop loading');
}
});
//Hyperlink2 doesnt work because it doesnt show the popup ti save the file
$$('.hyperlink2')[0].addEvent('click',function(){
console.log('hyperlink2 start loading');
new Request({
'url':this.get('href'),
'onComplete':function(){
console.log('hyperlink2 stop loading');
console.log('request complete : ',arguments);
}
}).GET();
return false;
});