Permalink
Browse files

Fix #2534: Don't pass a string argument to the XMLHttpRequest constru…

…ctor.
  • Loading branch information...
1 parent 1b14c03 commit ec59a626f298a44ea487e436899fd21e79636efd @philikon philikon committed Sep 5, 2012
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')
+ if window.ActiveXObject
+ xhr = new window.ActiveXObject('Microsoft.XMLHTTP')
+ else
+ xhr = new XMLHttpRequest()
xhr.open 'GET', url, true
xhr.overrideMimeType 'text/plain' if 'overrideMimeType' of xhr
xhr.onreadystatechange = ->

0 comments on commit ec59a62

Please sign in to comment.