Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 732147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:06:29+00:00 2026-05-14T07:06:29+00:00

I usually use JSON with jQuery to just return a string with html. However,

  • 0

I usually use JSON with jQuery to just return a string with html. However, I want to start to use Javascript objects in my code.

What’s the simplest way to get started using json objects on my page?

Here’s a sample Ajax call ( after $(document).ready( { ... }) of course:

 $('#btn').click(function(event) {
     event.preventDefault();
     var out = $('#result');
     $.ajax({ url: "CustomerServices.asmx/GetCustomersByInvoiceCount",
          success: function(msg) {
             // 
             // Iterate through the json results and spit them out to a page?
             // 
          },
                data: "{ 'invoiceCount' : 100 }"
     });
 });

My WebMethod:

[WebMethod(Description="Gets customers with more than n invoices")]
public List<Customer> GetCustomersByInvoiceCount(int? invoiceCount) {
    using (dbDataContext db = new dbDataContext()) {

        return db.Customers.Where(c => c.InvoiceCount >= invoiceCount);
    }
}

What gets returned:

{"d":[{"__type":"Customer","Account":"1116317","Name":"SOME COMPANY","Address":"UNit 1             , 392 JOHN ST.                            ","LastTransaction":"\/Date(1268294400000)\/","HighestBalance":13922.34},{"__type":"Customer","Account":"1116318","Name":"ANOTHER COMPANY","Address":"UNIT #345             , 392 JOHN ST.                            ","LastTransaction":"\/Date(1265097600000)\/","HighestBalance":549.42}]}

What I’d LIKE to know, is what are people generally doing with this returned json? Do you iterate through the properties and create an html table on the fly?

Is there way to “bind” JSON data using a javascript version of reflection ( something like the .Net GridView Control )

Do you throw this returned data into a Javascript Object and then do something with it?

An example of what I want to achieve is to have an plain ol’ html page ( on a mobile device )with a list of a Salesperson’s Customers. When one of those customers are clicked, the customer id gets sent to a webservice which retrieves the customer details that are relevant to a sales person.

I know the SO talent pool is quite deep so I figured you all here would be able to guide in the right direction and give me a few ideas on the best way to approach this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:06:29+00:00Added an answer on May 14, 2026 at 7:06 am

    I would recommend you have a look a the various client template solutions available. There are even talks of integration this with the next jQuery release here.

    I prefer jTemplate for its simplicity and small size. But there are others. If you want to see it in action check one of our clients sites here.
    We found that it scales very well even to a large amount of rows (>1000).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 420k
  • Answers 420k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It looks like your _location field is private. XML serialization… May 15, 2026 at 10:31 am
  • Editorial Team
    Editorial Team added an answer Look at the description for the dwFlags argument as described… May 15, 2026 at 10:31 am
  • Editorial Team
    Editorial Team added an answer The safest way to rename files is to refactor the… May 15, 2026 at 10:31 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.