I want to debug my response (json) and have it displaying as a string in a alert box. Are there any convenient thing to do?
var myjson = { Name : "Marko" };
alert(myjson.toString()); // ? [Object] !!!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The most convenient way, would be using the console of your browser.
In most browsers you get a very clearly view of the json contents.
Alternativly you could make a string with a for-loop:
But this is not recursively. Here is a working demonstration: http://jsfiddle.net/n695V/