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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:48:31+00:00 2026-05-20T18:48:31+00:00

I am trying to refresh a div on a page with the server name

  • 0

I am trying to refresh a div on a page with the server name the page is being displayed from. This is just for test so we can test what happens when a auth cookie times out. I want to do this with jquery but I can’t seem to get anything working. I found an example online that I have been working on but keep getting errors with it as well.

We have an html page on each of our servers that just contains the server name. It is the text from that page that we want displayed in the div.

Below is the code sample that I found. Can someone help me? I’m pretty new to jquery. Any help would be greatly appreciated.

Thanks,

`

<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/jquery-ui.min.js"></script>
<script src="../Scripts/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery.timers-1.0.0.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function () {
        var j = jQuery.noConflict();
        j(document).ready(function () {
            j(".refreshMe").everyTime(5000, function (i) {
                j.ajax({
                    url: "refresh.html",
                    cache: false,
                    success: function (html) {
                        j(".refreshMe").html(html);
                    }
                })
            })
        });
        j('.refreshMe').css({ color: "red" });
    });
</script>

`

  • 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-20T18:48:32+00:00Added an answer on May 20, 2026 at 6:48 pm

    Try this:

    $(document).ready(function () {
        var interval = 500;   //number of mili seconds between each call
        var refresh = function() {
            $.ajax({
                url: "path/to/server/page.php",
                cache: false,
                success: function(html) {
                    $('#server-name').html(html);
                    setTimeout(function() {
                        refresh();
                    }, interval);
                }
            });
        };
        refresh();
    });
    
    <div id="server-name"></div>
    

    So what is happening?

    I will call refresh once the page is ready, then an ajax call is made to path/to/server/page.php which will return the desired result.

    I show the results in div#server-name then I do a setTimeout which will call refresh again every interval mili seconds.

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

Sidebar

Related Questions

im trying to refresh a div on the page using jquery after a click
I am trying to implement paging across ajax calls. The page should not refresh
I am trying to refresh a certain part of my page with AJAX and
I'm trying to figure out how to submit my form with a page refresh.
Trying to setup an SSH server on Windows Server 2003. What are some good
Trying to get my css / C# functions to look like this: body {
Trying to find some simple SQL Server PIVOT examples. Most of the examples that
Trying to make a make generic select control that I can dynamically add elements
Trying to keep all the presentation stuff in the xhtml on this project and
Trying to do this sort of thing... WHERE username LIKE '%$str%' ...but using bound

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.