我正在使用以下 get getJSON
$.getJSON("js/production-data.json").done(function(response) {
console.log(response);
console.log('hello');
});
我可以在 Firebug 中看到正在检索数据,但没有用于 响应
的 console.log(这将是整个数据)。我什至也看不到 hello
。
最佳答案
尝试指定内联回调,例如:
var jqxhr = $.getJSON( "example.json", function() {
console.log( "success" );
});
作为另一个步骤,添加一个 always
处理程序,而不是仅 done
。
关于javascript - jQuery getJSON 无法看到 console.log,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24145999/