目前正在使用 firebug 调试应用程序,我想查看我的网址返回的 json/XML 值。 我使用 MVC 结构,因此接近
jQuery("#list1").jqGrid({
url:'http://localhost/Zend/jqueryapp/public/artist/index',
datatype: "json",
mtype: 'GET',
//console.log("http://localhost/Zend/jqueryapp/public/artist/index"),
console.log 位是挑战。
我该如何破解这个?
最佳答案
您可以通过在 Firebug 中展开网络选项卡下的请求来查看响应,无需任何额外的工作。
如果您不想在调试时深入研究,而只想立即输出值,那么您可以将日志记录放在请求后的回调中。
类似于:
jQuery("#list1").jqGrid({
url:'http://localhost/Zend/jqueryapp/public/artist/index',
datatype: "json",
mtype: 'GET',
loadComplete: function(xhr) {
//get values to log from xhr
//console.log()
},
关于javascript - 将 URL 返回值记录到 Firebug 控制台中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2154402/