Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- imageurl = "/images/products/" + item.id + "/" + item.productimage
- $.ajax({
- url: imageurl,
- type: 'HEAD',
- error: function() {
- //file not exists
- imageurl = "/images/products/" + item.productimage
- },
- success: function() {
- //file exists
- imageurl = "/images/products/" + item.id + "/" + item.productimage
- }
- });
- console.log('image: ' + imageurl);
Add Comment
Please, Sign In to add comment