“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 (101694)
- life (80213)
- inspirational (76842)
- humor (44879)
- philosophy (31492)
- inspirational-quotes (28589)
- god (27036)
- wisdom (24808)
- truth (24686)
- romance (24682)
- poetry (23688)
- life-lessons (22741)
- quotes (21331)
- death (20779)
- happiness (18972)
- hope (18783)
- faith (18592)
- inspiration (17985)
- spirituality (15985)
- motivational (15945)
- relationships (15830)
- religion (15523)
- life-quotes (15184)
- writing (15071)
- love-quotes (14830)
- success (14174)
- motivation (14020)
- time (12937)
- science (12234)
- motivational-quotes (12101)
