I am trying to set the src of and image tag like this:
var $img = $('img');
$img.error(function(){
$(this).attr('src', 'missingperson.gif');
})
.attr('src', urlToMyPhoto);
Since I have no rights to get this image it should go to the .error function. This is what happens in Chrome (desktop and Android). On Safari on iPhone I get a pop-up with authentication required. So the problem here is:
You can't suppress the popup. The only possibility I'm aware of, is to make an AJAX-request to the image and check for a 4XX-Status and then loading the images.
I'm not 100% sure that this works, but all in all, you can't suppress the popup in Safari, as far as I know.