MCPcopy Index your code
hub / github.com/blueimp/JavaScript-Load-Image / request

Function request

test/test.js:138–149  ·  view source on GitHub ↗

* Request helper function. * * @param {string} url URL to request * @param {Function} callback Request callback

(url, callback)

Source from the content-addressed store, hash-verified

136 * @param {Function} callback Request callback
137 */
138 function request(url, callback) {
139 var xhr = new XMLHttpRequest()
140 xhr.onload = callback
141 xhr.onerror = callback
142 try {
143 xhr.open('GET', url, true)
144 } catch (e) {
145 callback.call(xhr, e)
146 return
147 }
148 xhr.send()
149 }
150
151 describe('Loading', function () {
152 it('Return an object with onload and onerror methods', function () {

Callers 1

test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected