hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Hosting Talk Tutorials : Programming Tutorials : cool Javascript
Reply

Forum Jump

cool Javascript

Reply Post New Thread In Programming Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-27-2006, 06:34 PM
Sharewareisland Sharewareisland is offline
Disabled
 
Join Date: Aug 2006
Posts: 9

cool Javascript


cool Javascript that can tell u the last modied time of a page .htm page on anyones site

cut and paste this code into the url when u are a .htm page

javascript:alert(document.lastModified)

or bookmark that code or make it a link on the tool bar or something



Sponsored Links
  #2  
Old 08-28-2006, 12:13 AM
newyorker1907 newyorker1907 is offline
Newbie
 
Join Date: Aug 2006
Posts: 8
interesting. thanks

  #3  
Old 09-22-2006, 07:40 AM
Ranky Ranky is offline
Newbie
 
Join Date: Sep 2006
Posts: 8
That isn't a bad script. But it doesn't seem very complicated

Sponsored Links
  #4  
Old 12-06-2006, 12:08 AM
m4trix m4trix is offline
New Member
 
Join Date: Dec 2006
Location: Halifax, NS, Canada
Posts: 1
Quote:
Originally Posted by Ranky
That isn't a bad script. But it doesn't seem very complicated
Sometimes that is best.

K.I.S.S.

  #5  
Old 12-08-2006, 08:24 PM
adpyramid adpyramid is offline
Newbie
 
Join Date: Dec 2006
Posts: 12
I just keep getting the 'current' date/time... How do I use this again??

  #6  
Old 12-12-2006, 08:15 AM
ruptbot ruptbot is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Location: tikkabilla
Posts: 49
Quote:
Originally Posted by adpyramid
I just keep getting the 'current' date/time...
so do i, and i tried it on an old page that i know hasnt been updated

__________________
http://parked.net -100% Google Adsense Revenue | http://viphotels.co.uk - Worldwide VIP Hotels

  #7  
Old 12-14-2006, 09:17 PM
Googled Googled is offline
Web Hosting Master
 
Join Date: May 2005
Location: Planet Earth
Posts: 785
This is not what I call a cool javascript..

try :

document.write("Cool Javascript");

this is one

G

  #8  
Old 09-07-2011, 06:48 PM
Slepe Host Slepe Host is offline
Newbie
 
Join Date: Aug 2011
Posts: 16
If you put javascript:alert(document.lastModified) on a page or even on a old page it will return todays date. Because you are modifing by putting that in there???

__________________
SlepeHost provides excellent hosting at excellent prices.
We are dedicated to providing top quality hosting to a UK and Global market.
http://www.slepehost.co.uk/
For any information please contact support@slepehost.co.uk.

  #9  
Old 09-07-2011, 07:00 PM
8088 8088 is offline
Web Hosting Master
 
Join Date: Nov 2010
Posts: 615
With JavaScript, which is client-side in this case, you can't detect something server-side without having the server send that information. It will only show the last modified date if it was sent as a Last-Modified header by the server. If the header isn't sent, it wil show the current client's date and time.

Very old topic by the way.

  #10  
Old 09-03-2013, 10:42 PM
bizwhiz bizwhiz is offline
Newbie
 
Join Date: Aug 2013
Posts: 11
then can anyone suggest something else
a new JS code or in php

  #11  
Old 09-19-2013, 01:07 AM
zack2020 zack2020 is offline
New Member
 
Join Date: Apr 2012
Posts: 2
Quote:
Originally Posted by bizwhiz View Post
then can anyone suggest something else
a new JS code or in php
It isn't possible from a client's perspective. What happens when you paste this into your address bar is your browser is making an alert with the date and time that the header said the page was last edited on. With PHP, the underlying HTTP server will instead send the current date and time because the page is dynamically being created.

If you go to a static page which is hosted on a web server that sends the last modified date & time in the header, then you will get the correct time it was last modified.

For example, go to https://projects.csail.mit.edu/area2/public/ and try it out- it will work fine.

  #12  
Old 11-24-2013, 09:13 AM
marcoose81 marcoose81 is offline
Newbie
 
Join Date: Oct 2013
Posts: 8
Great - exactly what I've been looking for!

Reply

Related posts from TheWhir.com
Title Type Date Posted
Swarmify's New Approach to Content Delivery Uses Site Visitors to Accelerate Content Web Hosting News 2014-04-02 12:05:19
OpenStack and the AWS API Debate Web Hosting News 2013-07-30 14:21:54
Last night, WHIR Events made its annual stop in Scottsdale, AZ. Blog 2012-09-21 16:17:27
Rackspace Details New Cloud Hosting Control Panel Features Web Hosting News 2012-08-03 16:03:35
Web Host Bluehost Posts MobileMe Migration Video to Win Apple Customers Web Hosting News 2012-06-20 14:20:51


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?