I am trying to get data from a server using JSONP using jQuery ajax.
$.ajax({
dataType: "jsonp",
url: "https://secure.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json",
type: "GET",
data: "msg=aaa",
cache: true,
jsonp: "jsoncallback",
success: function(encryptedMsg){
console.log("Encryption success!");
},
error: function(req, errmsg, thrownError) {
console.log("Error: HTTP " + req.status + " " + errmsg);
}
});
However, the following error is displayed in the error console:
Error: jQuery1720502636097747291_1339479763752 is not defined
Source File: https://secure.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=jQuery1720502636097747291_1339479763752&msg=aaa
Line: 1
If you open the URL of the source file, you will see the following JSON, and it seems to be the correct JSON.
jQuery1720502636097747291_1339479763752({
"title": "Recent Uploads tagged cat",
"items": [
{
"title": "Chaton",
},
]
})
I also tried to specify the method name using jsonpCallback: "callbackmethod", but this did not work. I also used the $ .getJson () method and jquery-jsonp (http://code.google.com/p/jquery-jsonp/), but the result was the same.
Firefox browser and use of HTML4. This is used in the firefox add-on.
: https://builder.addons.mozilla.org/addon/1048275/revision/749
$.ajax getEncryptedMessage common-content.js
.