I have a function:
function CanDisplayImage() {
$("img").on('error', function() {
// do stuff
// and finally return false
return false;
});
// if there weren't any error in displaying image, return true
return true;
}
That function should check whether image can display correctly or not. I wasn't that function to return true or false, for example when I call that:
CanDisplayImage(); // get true or false
So if there weren't any error it will return true, but if there were error, it won't return false, because the function inside of that function will return false. Do U know how can I make that work?