Permalink
Browse files

Merge pull request #2535 from philikon/issue2534

Fix #2534: Don't pass a string argument to the XMLHttpRequest constructor
  • Loading branch information...
2 parents 1b14c03 + 78423e9 commit 2b86470665704d1b17cf51c03e591eb2c7a71453 @jashkenas committed Sep 7, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/browser.coffee
View
@@ -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 = ->

0 comments on commit 2b86470

Please sign in to comment.