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

  • Home
  • SEARCH
  • 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 6005039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:20:50+00:00 2026-05-23T01:20:50+00:00

I would like to update a table cell for a status obtained from a

  • 0

I would like to update a table cell for a status obtained from a jsp method. The method takes some time, hence it isn’t instant. Therefore I need ajax to refresh the page to get an updated status once the method completes

<script type="text/javascript">

    function updateTable()
        {
            var xmlhttp;
             var table = document.getElementById('theTable');

            if (window.XMLHttpRequest)
            {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp=new XMLHttpRequest();
            }

            else
            {// code for IE6, IE5
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }

            xmlhttp.onreadystatechange=function()
            {

                if (xmlhttp.readyState==4 && xmlhttp.status==200)
                {
                    document.getElementById('theTable').innerHTML=xmlhttp.responseText;
                }
            }

            xmlhttp.open(???);
            xmlhttp.send();

        }

    //Refresh every 2 seconds
    setInterval( doStuff, 2000 ); 

</script>

        <!-- The actual Table needed to updated -->

    </TABLE>
    <TABLE id="theTable">
     <TH>status</TH> 
     <tr>
      <td><%=status%></td>
     </tr>
    </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-05-23T01:20:51+00:00Added an answer on May 23, 2026 at 1:20 am

    On the server you need a jsp page that generates the table data when it is invoked. Say this is called generatetable.jsp. You can then use that URL in the open() method to invoke the jsp page.

    Your callback function will handle replacing the current table data with the new table data when it is received.

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

Sidebar

Related Questions

I ma new to jquery. I would like to update the table cell from
I would like to update a table in mySql with data from another table.
I have a table in MS SQL 2005. And would like to do: update
I would like to compare two tables and then update if some logic is
I would like to update (change the content) some part of the webpage without
I would like to do something like the following UPDATE table SET column =
I would like to update multiple records in a MySQL table using a single
I want to write reusable code that takes an HTML table from a JSP
I would like to update my SQL lite database with the native update-method of
I have a couple of tables (mySQL) that i would like to update with

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.