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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:38:36+00:00 2026-05-27T17:38:36+00:00

i have ajax call which is returning data to me . Say i have

  • 0

i have ajax call which is returning data to me .

Say i have ajax returning data

$.ajax({
            url : "quoteSearch",
            dataType : "json",
            data : $("#searchCriteria").serialize(),
            success : function(data) {
                populateTable(data);

            },
            error : function(data) {
                console.log(data);
            }
        });

Now i want to use this table data to update the UI.

Say if i add 10 to input box. and click go button it should add 10 to all quotes of the column.

How should i do 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-27T17:38:36+00:00Added an answer on May 27, 2026 at 5:38 pm

    You seem to be asking how to use the data returned by the ajax call from another part of your code at a non-specific time depending on when the user clicks a button. If so, you can save data in a variable with scope outside the ajax call, then access it from other parts of your code:

    var ajaxData;
    
    $.ajax({
       url : "quoteSearch",
       dataType : "json",
       data : $("#searchCriteria").serialize(),
       success : function(data) {
          ajaxData = data;
          populateTable(data);
       },
       error : function(data) {
          console.log(data);
       }
    });
    
    $("#yourbutton").click(function(){
       // do something with ajaxData
       if (typeof ajaxData != "undefined") {
          var valueToAdd = $("#yourinput").val();
          // your processing here
       }
    });
    

    The undefined test is to allow for if you click the button before the ajax call has finished at which point ajaxData would (obviously) not yet have a value.

    You may want to update your populateTable() function so that it takes a parameter with the value to add. Then inside your ajax success you set that parameter to 0, but inside your button click handler you set that parameter to the value of your input. Presumably your populateTable() function already knows how to retrieve the values from data, so you can do the extra addition within that functionality. I really can’t advise anything more specific without seeing the rest of your code.

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

Sidebar

Related Questions

I have a simple ajax call: $.ajax({url: my_url_here, dataType: 'text', success: function(data, textStatus) {
i have an ajax call $.ajax({ url: '<%=Url.Action(SaveDetails,Survey) %>', dataType: 'JSON', cache: false, data:
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
I'm making an AJAX call which returns XML data, and this is my 'success:'
I have following ajax call in my JavaScript code url = 'http://news.ycombinator.com/?callback=?'; $.ajax({url:url ,async:!1,dataType:'script',
I have a form, which sends data through a Jquery Ajax Call over to
I have an element which autosaves its contents via an AJAX call. Currently, whenever
On my main page I have this jquery code which does an ajax call
I have an ajax call that fires multiple times but is called once. function
I have an ajax call. I put the return value (data) in a variable

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.