mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fix #2534: Don't pass a string argument to the XMLHttpRequest constructor.
This commit is contained in:
@@ -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 = ->
|
||||
|
||||
Reference in New Issue
Block a user