Skip to content

Commit

Permalink
Merge pull request jashkenas#2535 from philikon/issue2534
Browse files Browse the repository at this point in the history
Fix jashkenas#2534: Don't pass a string argument to the XMLHttpRequest constructor
  • Loading branch information
jashkenas committed Sep 7, 2012
2 parents 1b14c03 + 78423e9 commit 2b86470
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/browser.coffee
Expand Up @@ -18,7 +18,10 @@ return unless window?

# Load a remote script from the current domain via XHR.
CoffeeScript.load = (url, callback) ->
xhr = new (window.ActiveXObject or XMLHttpRequest)('Microsoft.XMLHTTP')
xhr = if window.ActiveXObject
new window.ActiveXObject('Microsoft.XMLHTTP')
else
new XMLHttpRequest()
xhr.open 'GET', url, true
xhr.overrideMimeType 'text/plain' if 'overrideMimeType' of xhr
xhr.onreadystatechange = ->
Expand Down

0 comments on commit 2b86470

Please sign in to comment.