【发布时间】:2012-03-10 07:08:20
【问题描述】:
在How to use Ajax.BeginForm MVC helper with JSON result? Joel 的帖子中引用了如下解决方案:
function onTestSuccess(data, status, xhr) {
console.log("data", data);
console.log("xhr", xhr);
console.log("status", status);
// Here's where you use the JSON object
//doSomethingUseful(data);
}
如何在我的代码中引用 JSON 对象“数据”中的元素? 我的控制台日志显示以下内容: LOG: 数据{"success":true,"uri":"/Image/Confirm2?category=foo"}
我正在尝试在我的 jquery 代码中使用“uri”的值。我试过了:
console.log("uri", data.uri);
但结果如下:
日志:datauriundefined
【问题讨论】:
标签: asp.net-mvc-3 jquery