So, I have following js function:
function check_image(imgs){
var img = jQuery(imgs); //This loads the image
img.on('load', function(e){ //success
var display = 'display';
}).on('error', function(e) { //error
var display = 'display_none';
});
return display;
};
Based on whether the image is available or not, I am trying to return a certain value.
I need to return the display
var but I am having a hard time why it is not working.
Could someone help me out?
Thanks