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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:55:18+00:00 2026-05-29T06:55:18+00:00

This is for a server status page using php and jquery. The page can

  • 0

This is for a server status page using php and jquery. The page can be described as a table of appservers and webservers with empty cells where the status will appear on a button click. When clicking the button many instances of a servercheck.php script will be fired off asynchronously (the reason for using jquery instead of synchronous PHP-only) and the results are returned to the correct cell in the table according to the id of the td element.

All of which is kinda irrelevant other than background info.

So when the page first loads, a cell like this is waiting to be populated:

    <td id="a101-w01">&nbsp</td>

So I have a working .load() and example of which would be:

$("#a101-w01").load(\"singleServerCheck.php?&appserver=appservera&webserver=webserver1");

which would return something like:

<td id="a101-w01" class="up">Server UP</td>

I cant just use (“#a101-w01”).load() because that only replaces the contents of the element, not the element itself (thus creating a cell inside the already existing cell instead)

What I want is this

<td id="a101-w01">&nbsp</td>

to be replaced with this

<td id="a101-w01" class="green">SERVER UP</td>

Urgh that was kinda hard to explain 🙂 Anyway I have tried something like this:

$("#a101-w01").replaceWith().load(\"singleServerCheck.php?&appserver=appservera&webserver=webserver1");

and

$("#a101-w01").replaceWith(.load(\"singleServerCheck.php?&appserver=appservera&webserver=webserver1"));

but they are not right … Can someone help this n00b to bring the two functions together?? 🙂

  • 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-29T06:55:19+00:00Added an answer on May 29, 2026 at 6:55 am

    Replacing td is not correct. I see what you are trying to do which is very simple. Try something like this.

    Return just a string "SERVER UP" or "SERVER DOWN" from the server side and using that change add the required text and class

    $.get("singleServerCheck.php?&appserver=appservera&webserver=webserver1", function(data){
         $('#a101-w01').html(data).addClass(data == "SERVER UP" ? "green" : "red");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jQuery to call a php page (via ajax) that goes to
In C# you can use verbatim strings like this: @\\server\share\file.txt Is there something similar
So I'm using this SQL Server with my application and I decided to display
I have this function coded to check the status of a Rapidshare link using
Can I make internet explorer render the page when in php i use flush()
I'm using Drupal 6.x and I'm writing a php class that will grab an
I'm using AJAX to get data from server. The following is the php file.
Hey i need help with this server status script. What is happening is when
This article states that If your site is run on a shared Web server,
My Ubuntu server has Apache and Subversion installed. I use this server as a

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.