(method, url)
| 1 | 'use strict'; |
| 2 | |
| 3 | function createCORSRequest(method, url) { |
| 4 | var xhr = new XMLHttpRequest(); |
| 5 | if ('withCredentials' in xhr) { |
| 6 | // XHR for Chrome/Firefox/Opera/Safari. |
| 7 | xhr.open(method, url, true); |
| 8 | } else if (typeof XDomainRequest !== 'undefined') { |
| 9 | // XDomainRequest for IE. |
| 10 | xhr = new XDomainRequest(); |
| 11 | xhr.open(method, url); |
| 12 | } else { |
| 13 | // CORS not supported. |
| 14 | xhr = null; |
| 15 | } |
| 16 | return xhr; |
| 17 | } |
| 18 | |
| 19 | function ajaxUpload({url, name, cors, file, onProgress, onLoad, onError, withCredentials}) { |
| 20 | let data = new FormData(); |
no test coverage detected
searching dependent graphs…