“function imgLoad(url) { return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); request.open('GET', url); request.responseType = 'blob'; request.onload = function() { if (request.status === 200) { resolve(request.response); } else { reject(Error('Image didn\'t load successfully; error code:' + request.statusText)); } }; request.onerror = function() { reject(Error('There was a network error.')); }; request.send(); }); }”
―
Mastering JavaScript: A Complete Programming Guide Including jQuery, AJAX, Web Design, Scripting and Mobile Application Development
Share this quote:
Friends Who Liked This Quote
To see what your friends thought of this quote, please sign up!
0 likes
All Members Who Liked This Quote
None yet!
This Quote Is From
Mastering JavaScript: A Complete Programming Guide Including jQuery, AJAX, Web Design, Scripting and Mobile Application Development
by
Michael B. White10 ratings, average rating, 2 reviews
Browse By Tag
- love (101742)
- life (79721)
- inspirational (76163)
- humor (44485)
- philosophy (31132)
- inspirational-quotes (29012)
- god (26970)
- truth (24811)
- wisdom (24750)
- romance (24445)
- poetry (23411)
- life-lessons (22732)
- quotes (21212)
- death (20611)
- happiness (19108)
- travel (18682)
- hope (18637)
- faith (18504)
- inspiration (17437)
- spirituality (15791)
- relationships (15718)
- life-quotes (15651)
- religion (15430)
- love-quotes (15424)
- motivational (15421)
- writing (14977)
- success (14221)
- motivation (13310)
- time (12904)
- motivational-quotes (12652)
