Solved

Need to view the JSON data

Posted on 2011-09-20
8
279 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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
 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

778 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