Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

Need to view the JSON data

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
newbieweb
Asked:
newbieweb
  • 4
  • 3
4 Solutions
 
leakim971PluritechnicianCommented:
// 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
 
newbiewebSr. Software EngineerAuthor Commented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Gurvinder Pal SinghCommented:
nothing, does it give compilation error?
have you done this to it before
var data = eval(jsonData);
0
 
newbiewebSr. Software EngineerAuthor Commented:
No, I have not. But the whole JSON object is linked to a jqGrid.
0
 
newbiewebSr. Software EngineerAuthor Commented:
I use Firebug and Firefox. How do I find a compliance error?
0
 
Gurvinder Pal SinghCommented:
you should be able to see them on the console
0
 
newbiewebSr. Software EngineerAuthor Commented:
The problem involved being attached to the jqgrid, I think...
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now