MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / loadFromUrl

Function loadFromUrl

libraries/p5.js:2260–2273  ·  view source on GitHub ↗
(url, callback)

Source from the content-addressed store, hash-verified

2258}
2259
2260function loadFromUrl(url, callback) {
2261 var request = new XMLHttpRequest();
2262 request.open('get', url, true);
2263 request.responseType = 'arraybuffer';
2264 request.onload = function() {
2265 if (request.status !== 200) {
2266 return callback('Font could not be loaded: ' + request.statusText);
2267 }
2268
2269 return callback(null, request.response);
2270 };
2271
2272 request.send();
2273}
2274
2275// Public API ///////////////////////////////////////////////////////////
2276

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected