When I make the following jQuery call
$.post('/publish/comments',
parms,
function(data, textStatus){
console.log('textStatus: ' . textStatus);
console.log('returned data: ' . data);
console.log('nextPage: ' . data.nextPage);
},
"json"
);
the console shows that data, textStatus, and data.nextPage are all undefined.
But in the Chrome dev tools (network tab) I can see that the following JSON data is being pass back from the server.
{success:true, nextPage: /go/page/requestId/182/src/publish}
nextPage: "/go/page/requestId/182/src/send"
success: true
Thoughts?
As Felix pointed out concats need “+”
Also, I have found that if you want to log an entire object, you don’t want to include strings inside your console.log().
Try
console.log(data)instead of putting strings before it (like “data: “) this will guarantee that the whole object can be seen in the console.