example of jquery to render json data on browser

can you please give an example of jquery/ajax to fetch server data and render json data on browser
jgdvishnuSoftware ArchitectAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Julian HansenConnect With a Mentor Commented:
// setup your vars to where you want to go
var url = 'http://someurl.com';

// and maybe some parameters of what you want to get
var data = {
   id: $('#somefield').attr('id');

// Post to the server as with a dataType of JSON
// Assuming server returns a JSON structure
// status : ok | fail
// error : if status = fail then this will be set to error message
// items : array of items 
//     text
//     add other variables here if you need them

$.post(url, data, function(response) { 
   // response ok so create list
   if (response.status == 'ok') {
     // in this case return is a list of items for a <ul> - so loop through 
     // and display them.
     for(i =0; i<response.items.length;i++) {
   else {
 }, 'json');

Open in new window

Full code attached
working sample here http://www.marcorpsa.com/ee/t241.html
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Julian HansenCommented:

Please explain the C grade.

Have you read the grading guidelines?

A C grade for the answer here was really insulting.

Please read this article for information on how questions should be graded

jgdvishnuSoftware ArchitectAuthor Commented:
want to change it to Grade A
Julian HansenCommented:
@jgdvishnu - it has been - thank you.
All Courses

From novice to tech pro — start learning today.