Solved

Need to view the JSON data

Posted on 2011-09-20
8
270 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
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…

758 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

18 Experts available now in Live!

Get 1:1 Help Now