Image src cross domain??????
Hi friends, I need to download some images from a server in a list,
the "src" of the images i get from a json parsing whith ajax call.
But the images never loads because the src is other domain.
Ej:
json server: [url]http://www.jsonserver.com[/url]
Image server: [url]http://www.images-server.com[/url]
function getGentePorProximidad(token) {
var sucho='';
var countItems=0;
$.ajax({
url : $URL+'buscarUsuariosPorProximidade&interface_acesso=nokiaweb&id_pais_acesso=AR&token='+token+'&inicio=0&quantidade=4',
dataType : 'json',
async : false,
crossDomain : false,// I already changed false to true here
success : function(data, textStatus, jqXHR) {
$.each(data, function(key, val) {
if('usuarios'==key){
$.each(val, function(key1, val1) {
countItems++;
var imagen = val1.url_foto.replace('##RES##','25x25');
imagen= imagen.replace('##EXT##','png');
sucho=sucho+'<img src="'+imagen+'" />'; //Images never loads
sucho=sucho+'<br/><p>'+imagen+'</p>'; // The url its OK example: [url]http://www.images-server.com/img.png[/url]
});
}
});
$('#listaGenteCerca').html(sucho);
mwl.toggle('#login');
mwl.toggle('#cerca');
},
error : function(jqXHR, textStatus, errorThrown) {
mwl.toggle('#login');
mwl.toggle('#error404');
}
});
}
Re: Image src cross domain??????
Extremely naive check: can you load those images with a simple, static page (placed on [url]www.jsonserver.com[/url] of course)? If [url]www.images-server.com[/url] does not like outsiders at all, the script has no chance either.