daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Nov 22nd, 2017 56 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. imageurl = "/images/products/" + item.id + "/" + item.productimage
  2. $.ajax({
  3.     url: imageurl,
  4.     type: 'HEAD',
  5.     error: function() {
  6.         //file not exists
  7.         imageurl = "/images/products/" + item.productimage
  8.     },
  9.     success: function() {
  10.         //file exists
  11.         imageurl = "/images/products/" + item.id + "/" + item.productimage
  12.     }
  13. });
  14. console.log('image: ' + imageurl);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top