Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2535 from philikon/issue2534

Fix #2534: Don't pass a string argument to the XMLHttpRequest constructor
  • Loading branch information...
commit 2b86470665704d1b17cf51c03e591eb2c7a71453 2 parents 1b14c03 + 78423e9
@jashkenas authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/browser.coffee
View
5 src/browser.coffee
@@ -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 = ->
Please sign in to comment.
Something went wrong with that request. Please try again.