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 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

I'm trying to refresh a page without sending POST from the previous time. I've
im trying to refresh a div on the page using jquery after a click
Goal: I'm trying to refresh content inside a div so that if the user
I am trying to refresh the page after a cgi execution. In my cgi,
I have a page we can call parent.php . In this page I have
I am trying to create a user interface, but when I refresh the page,
I have the following code. I am trying to prevent my page from resubmitting
I am trying to refresh a certain part of my page with AJAX and
I'm trying to refresh some part of a page with an async call with
I'm trying to use jQuery to make a slightly more sophisticated page refresh. 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.