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 8517649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:45:46+00:00 2026-06-11T05:45:46+00:00

I have some json objects which are returned based on user input $(‘#button’).click(function ()

  • 0

I have some json objects which are returned based on user input

$('#button').click(function () {
        var usersData= $('input[name="UserInputData"]').val();

        $.ajax({
            type: 'POST',
            contentType: 'application/json; charset=utf-8',
            data: JSON.stringify({ UserInputData: usersData}),
            url: '/Home/Data',
            success: function (result) {
                $.each(result, function (i, item) {
                    // how to invoke data table and populate with returned
                    // item object, for ex. item.Title                    
                });
            },
            error: function () { alert("error"); }
        });
    });

Just to clarify I’m getting list of json object from controller, that’s ok, I’m struggle with how to display these data on data table.

  • 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-06-11T05:45:48+00:00Added an answer on June 11, 2026 at 5:45 am
    success: function (result) {
        //if table is already on the page
        var table = $("table-selector");
        table.find("tr").remove(); //remove all previous rows if needed
    
        //or, if table does not exist
        var table = $("<table></table>");
        $("table-container-selector").append(table);
    
        $.each(result, function (i, item) {
            var tr = $("<tr></tr>");
            table.append(tr);
    
            var td = $("<td>" + item.field1 + "</td>");
            tr.append(td);
    
            var td = $("<td>" + item.field2 + "</td>");
            tr.append(td);
    
            var td = $("<td>" + item.field3 + "</td>");
            tr.append(td);
        });
    },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some objects deserialized from JSON to which I'd like to assign a
I have some json-code which has multiple objects in it, as such: [ {
I have some JSON-code which has multiple objects in it: [ { MNGR_NAME: Mark,
I have an array of JSON objects, some of which contain key/value pairs for
I have looked at GSON to parse some of my JSON objects. However, this
I am trying to output some Java objects as JSON, they have List properties
Inside my .aspx I have some JSON code that looks like this: function someFunctionName()
I have a Django database, in which I have some JSON stored. I wish
I have a MongoDB Collection called Questions which holds JSON Objects that look like
I have an iOS app which gets some JSON from a server (in the

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.