I have read up a lot on stackoverflow about everything on JSONP.
I am trying to get images from my web service but due to some domain policy, I have to use JSONP.
So currently here is my codes to get JSONP's data.
$.ajax({
url: 'http://example.com/1?callback=test',
type: 'GET',
dataType: 'jsonp',
success: function(test) {
var content = ' ';
for(var i=0; i<test.length;i++) {
if(test.status == 0) {
content += '<img src="' + result.images[i].s3File.url +'">';
}
}
$( ".images" ).HTML(content);
}
});
So what I am currently getting is..
Uncaught SyntaxError: Unexpected token : http://example.com/1?callback=test?jQuery191014008507528342307_1414476410551&_=1414476410552:1
I read up a lot on this topic about the callback, but I really have no idea how do I use the callback function to retrieve the images. Can someone please teach me?