Skip to content

Commit

Permalink
remove old IE JSONP handling hack
Browse files Browse the repository at this point in the history
  • Loading branch information
inf0rmer committed Sep 14, 2012
1 parent c0abb69 commit 86f2b35
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions reqwest.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,12 @@
script.type = 'text/javascript'
script.src = url
script.async = true
if (typeof script.onreadystatechange !== 'undefined') {
// need this for IE due to out-of-order onreadystatechange(), binding script
// execution to an event listener gives us control over when the script
// is executed. See http://jaubourg.net/2010/07/loading-script-as-onclick-handler-of.html
script.event = 'onclick'
script.htmlFor = script.id = '_reqwest_' + reqId
}

script.onload = script.onreadystatechange = function () {
if ((script[readyState] && script[readyState] !== 'complete' && script[readyState] !== 'loaded') || loaded) {
return false
}
script.onload = script.onreadystatechange = null
script.onclick && script.onclick()
// Call the user callback with the last value stored and clean up values and scripts.
o.success && o.success(lastValue)
lastValue = undefined
Expand Down

0 comments on commit 86f2b35

Please sign in to comment.