Solved

Need to view the JSON data

Posted on 2011-09-20
8
275 Views
Last Modified: 2012-05-12
I need to debug a problem in the Console but need to see the contents of an array of JSON objects.

How can I do this?

I know the format in C# of the object, which has a property Name. But when I use $(this).Name it comes back undefined. How can I access this property from a JSON object?

Thanks!
0
Comment
Question by:newbieweb
  • 4
  • 3
8 Comments
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 375 total points
ID: 36568654
0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 125 total points
ID: 36568771
// this is you ajax callback part
function(data) {
     alert( data["Name"] ); // if you've something like { "Name":"mssmlfsfmslfk", "Id":123 }
// else try :
     alert( JSON.stringify(data) );
0
 

Author Comment

by:newbieweb
ID: 36568935
I can print data.Name and that prints the right name to the console. But I have trouble with this:

If (data.Name == "HI" )

what's wrong with my format?
0
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 375 total points
ID: 36568961
nothing, does it give compilation error?
have you done this to it before
var data = eval(jsonData);
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:newbieweb
ID: 36569039
No, I have not. But the whole JSON object is linked to a jqGrid.
0
 

Author Comment

by:newbieweb
ID: 36569042
I use Firebug and Firefox. How do I find a compliance error?
0
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 375 total points
ID: 36569047
you should be able to see them on the console
0
 

Author Closing Comment

by:newbieweb
ID: 36569440
The problem involved being attached to the jqgrid, I think...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now