“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 (101885)
- life (80467)
- inspirational (77110)
- humor (44986)
- philosophy (31624)
- inspirational-quotes (28656)
- god (27064)
- wisdom (24910)
- romance (24794)
- truth (24772)
- poetry (23787)
- life-lessons (22834)
- quotes (21423)
- death (20850)
- happiness (18997)
- hope (18836)
- faith (18618)
- inspiration (18020)
- spirituality (16028)
- motivational (16015)
- relationships (15942)
- religion (15546)
- life-quotes (15257)
- writing (15105)
- love-quotes (14865)
- success (14208)
- motivation (14072)
- time (12991)
- science (12275)
- motivational-quotes (12135)
