Created
September 8, 2011 23:14
-
-
Save beatgammit/1205053 to your computer and use it in GitHub Desktop.
Reqwest timeout bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bug() { | |
window.reqwest({ | |
'url': 'http://thisdoesntexisthahahaha.com', | |
'timeout': 1000 * 5, | |
'type': 'html', | |
'success': function () { | |
alert('http://thisdoesntexisthahahaha.com exists??'); | |
}, | |
'error': function () { | |
console.error('Error, trying again'); | |
setTimeout(bug, 1000 * 5); | |
} | |
}); | |
} | |
var head= document.getElementsByTagName('head')[0]; | |
var script= document.createElement('script'); | |
script.type= 'text/javascript'; | |
script.src= 'https://raw.github.com/ded/reqwest/master/reqwest.js'; | |
head.appendChild(script); | |
// no IE support, hahahaha | |
script.onload = bug; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment