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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:32:03+00:00 2026-06-16T04:32:03+00:00

I am trying to find a plugin or function in either JavaScript, jQuery, or

  • 0

I am trying to find a plugin or function in either JavaScript, jQuery, or even PHP if necessary to check every 10 seconds if the page file has been updated and alert() the user if the page has been updated.

Thanks in advance 🙂
Sorry if I’m not clear enough. Comment if you have any questions.

EDIT: In other words using either client or server side scripting, send an AJAX request to the server and determine if the current page opened by the user has been modified on the server and display an alert.

  • 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-06-16T04:32:04+00:00Added an answer on June 16, 2026 at 4:32 am

    You can send a http HEAD request to the server every 10 seconds. This will make the server just send the headers not the content. Then you can chech the ‘Last-Modified’ response header.

    The jQuery function $.ajax(); supports a functionality quite similar to this. But rather then checking the Last-Modified http header jQquery sends requests to the server using the http If-Modified-Since header. It then checks if the server responds with response code 304 Not Modified.

    This is a short HTML + Javascript example described the jQuery functionality:

    <html>
      <head>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
        <script type="text/javascript">
          var checkUrl="test.txt";
          var firstCheck = false;
          window.setInterval(checkForUpdate, 1000);
    
          function checkForUpdate() {
              $.ajax(checkUrl, {
                  ifModified : true,
                  type : 'HEAD', 
    
                  success : function (response) {
                      if(firstCheck === false) {
                          firstCheck = true;
                          return;
                      }
                      $('#output').html('the site has been modified');
                  }
              }); 
          }    
       </script> 
      </head>
      <body>
        <div id="output">Not Modified</div>
      </body>
    </html>
    

    However, the above jquery example didn’t worked for me – using jQuery 1.8 and firefox.(Linux) + the apache2 web server. The success function will be called although the server responds with 304 Not Modified.

    So I’ll add another working example that implements my first suggestion above, here comes the javascript part:

        var checkUrl="test.txt";
        window.setInterval("checkForUpdate()", 1000);
        var pageLoad = new Date().getTime();
    
        function checkForUpdate() {
            $.ajax(checkUrl, {
                type : 'HEAD',
                success : function (response, status, xhr) {
                    if(firstCheck === false) {
                        firstCheck = true;
                        return;
                    }
                    // if the server omits the 'Last-Modified' header
                    // the following line will return 0. meaning that
                    // has not updated. you may refine this behaviour...
                    var lastModified = new Date(xhr.getResponseHeader('Last-Modified'))
                        .getTime();
                    if(lastModified > pageLoad) {
                        $('#output').html('the site has been modified');
                    }
                }
            }); 
        }  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find out if anyone knows about an already existing jQuery plugin
I'm using the validate plugin from http://bassistance.de/jquery-plugins/jquery-plugin-validation/ What i'm trying to find is a
I'm trying to make a Jquery plugin ( findFirst() ) to find the first
I have been trying to make jquery datepicker plugin work on a content page
I'm trying to write a plugin that calls a function (icalendar-import-file) which has the
Really, really trying to find a plugin that gives adds functionality to the image-resize
Revising code of jQuery.reveal plugin (http://www.zurb.com/playground/reveal-modal-plugin) and trying to understand how it handles the
I'm trying to combine the jquery datepicker with the jqplot plugin. Basically, I'm having
I'm trying to make a jQuery plugin that executes a method on a timer.
I am trying to use the jQuery CSV plugin, as documented here: http://code.google.com/p/js-tables/wiki/CSV According

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.