Search the Community
Showing results for tags 'promise'.
Check if an image actually resolves to a successful HTTP status code e.g. 200 (OK). imageExists returns a promise, so make sure the browser you're using supports promises e.g. Chrome. If not, then you can look at using a polyfill (https://github.com/components/es6-promise) or if you're feeling adventurous, then change the code to use jQuery's deferreds (not recommended). To see it working, copy the code to http://www.es6fiddle.net/ and watch the images either resolve or fail (reject). /*global console, Promise*/ /** * Check if an image is resolvable i.e. returns a HTTP status co