我在外部域上有一个具有以下 JSON 格式的文件:
{"image":"http:\/\/magazine.domain.com\/wp-content\/uploads\/2013\/06\/festival_home-240x122.jpg","link":"http:\/\/magazine.domain.com\/category\/fashion\/forget-the-mud-festival-fashion-essentials\/","title":"FESTIVAL FASHION ESSENTIALS","description":"What to wear at festivals is a perennial problem for music lovers, follow our fashion guide and be the best dressed moshing in the mud this summer!"}
我需要使用 JSONP 获取数据并将格式更改为:
jsonCallback ({"image":"http:\/\/magazine.domain.com\/wp-content\/uploads\/2013\/06\/festival_home-240x122.jpg","link":"http:\/\/magazine.domain.com\/category\/fashion\/forget-the-mud-festival-fashion-essentials\/","title":"FESTIVAL FASHION ESSENTIALS","description":"What to wear at festivals is a perennial problem for music lovers, follow our fashion guide and be the best dressed moshing in the mud this summer!"});
我正在使用 jquery 1.3.2,我目前无法升级它并尝试了以下方法:
var url='http://magazine.domain.com/test1.js?callback=?';
$.getJSON(url, function(data){
console.log(data);
});
我收到以下错误 - Uncaught ReferenceError: jsonCallback is not defined。
有人可以帮忙吗。