[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 752
  • Last Modified:

Check to See When the Web Page Was Last Updated

With the URL that I want to check, I entered:
javascript:alert(document.lastModified)

In Firefox, nothing came up.  In IE, the current date / time came up.  I tested this on a web page that I knew was updated a month ago, so I know this is not correct.

In Firefox, I went to Information - Page Information.  The date that was in the Modified was Sunday, August 26, 20.12 08:05:26.  Closing that box and hitting reload, the time was updated to the current time.

I don't know think that Google Analytics would matter - I checked a page that did not have this.  

The pages are .jsp and .asp - I don't know if that matters (since the page is be created at the time it is created on the server)?

Thank you!
0
coreybryant
Asked:
coreybryant
  • 5
  • 5
3 Solutions
 
GaryCommented:
Are we talking classic asp?
If so the page is compiled at run time so the last modified will always be the current time.
One solution is to put the js in an include file or use asp to actually read the file date.
0
 
Erdinç Güngör ÇorbacıPHP Development Team LeaderCommented:
As told in here (http://www.bloggingdeveloper.com/post/How-To-Display-the-Last-Modified-Date-of-a-Document-using-Javascript-Javascripts-document-lastModified-Property.aspx)

In order for this property to work, the server has to send the information to the browser. which is widely supported by the browsers nowadays.

 When a server does not send a lastModified date information to the browser, Netscape and Opera give a last modification date of 01/01/1970 at 00:00:00 hrs, while Internet Explorer gives today. So it is always a good practice to test the server if it is sending the necessary information to the browser before using this script.

So either be sure your server sends this information or try to adapt a PHP/.NET aided solution which sends info from serverside
0
 
coreybryantAuthor Commented:
It is a .jsp that I am actually wanting to know when it was updated.  

I tried Opera and it also gave the current date. I guess their server is not sending the information.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Erdinç Güngör ÇorbacıPHP Development Team LeaderCommented:
If your platform is java then  sending the -file last modified time- data from serverside to client side though GET (or something else)  is a better idea i think.
capture the modified time at serverside then append to url like

page.jsp?query_string=somethingelses&last-modified=[lastmodifiedtimefromjava]
0
 
coreybryantAuthor Commented:
Ok, thanks.  Let me try that when I get home - if they have not updated the page.  But I did print it.

Any particular browser?
0
 
Erdinç Güngör ÇorbacıPHP Development Team LeaderCommented:
You can do the solution i told only to the sites you control. Serverside changes has to be done for this. So if you are planning learn last updated time for a remote site page you can't use serverside solution.
By the way why you need this , maybe we can find another way to get around that.
0
 
coreybryantAuthor Commented:
I tried in IE, but it did not work.  

If I don't control website, is there another way?
0
 
Erdinç Güngör ÇorbacıPHP Development Team LeaderCommented:
Thats more than a browser issue thats about server remote file hosted.

As i mentioned in my first comment server has to send you last modified time

if you can use PHP on your own server put these in a file and run there you will be sure if server sends that info or not.

<?php

$url = "http://us.php.net";
$curl = curl_init();

    curl_setopt($curl, CURLOPT_URL,$url);
    //don't fetch the actual page, you only want headers
    curl_setopt($curl, CURLOPT_NOBODY, true);
    curl_setopt($curl, CURLOPT_HEADER, true);
    //stop it from outputting stuff to stdout
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

    // attempt to retrieve the modification date
    curl_setopt($curl, CURLOPT_FILETIME, true);

    $result = curl_exec($curl);
    
    $info = curl_getinfo($curl);
    
    echo "<pre>";
	print_r($info);
    echo "</pre>";
	if ($info['filetime'] != -1) { //otherwise unknown
        echo date("Y-m-d H:i:s", $info['filetime']); //etc
    }

?>

Open in new window


if you are given you will see a date like this but this is also not so reliable because as you can see php.net refreshes that time because php is creating page on the php on every request.
0
 
coreybryantAuthor Commented:
I did some screen shots and had that put the time on there.  Plus I printed it with the time  /  date in footer.    

Basically, this company was telling me that my medical test was $2,775.00 or if I qualified, it would be $683.75.


However on their sites and what they tell the doctors is $500.00.  Their site states
This program limits patient cost to 20% or $500 (whichever amount is less) for any of Company tests.
The paperwork they sent me - they wanted $683.75.  

My results were supposed to have been received today to make sure I am on the correct treatment for Multifical Motor Neuropathy.  This has only been discovered in the past 20 years and before then, people were being diagnosed with ALS.  

I had already seen two neurologists that mis-diagnosed me and fortunately I had my own.  Within a week I  was dianosed and it takes some people three years for a proper diagnosis.  And with nerves only growing about 1 ml a day - it might take 75-90 days to get full recovery.

It was just frustrating because Quest boast of technology on their site everywhere, but a simple phone call, fax, could not be made.   I even tried to conference them together, but the company that Quest owns says they received the fax and it is being handled.

So it seems like this is just more server side.  But after my 12 page fax showing them hw easy it, the test is being processed
0
 
coreybryantAuthor Commented:
Thanks for the help / suggestions / support for Check to See When the Web Page Was Last Updated
0
 
Erdinç Güngör ÇorbacıPHP Development Team LeaderCommented:
Hmmm very disgusting procedures :(  .... I hope you get what you wish.
If you cannot try php solution you can send me the url of target site so that i can send you a result dump here.
CYS
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now