In the post How to use Ajax.BeginForm MVC helper with JSON result? Joel references a solution as follows:
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);
}
How do I reference elements in the JSON object "data" in my code? My console log shows the following: LOG: data{"success":true,"uri":"/Image/Confirm2?category=foo"}
I am trying to use the value of "uri" in my jquery code. I've tried:
console.log("uri", data.uri);
but get the folowing as a result:
LOG: datauriundefined