473,513 Members | 2,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JS - checking a file update

Hi all,

Sorry if this is a silly question but I've been having a heck of a hard
time with it and hope somebody here can lend me a hand.

I have a site with a news pages and I'd like the navigation to include a
blinking 'NEW!' when that page has been updated within the last three days.

It works fine for the one page (if you're on the news page, it works great)
but I can't figure out how to check the time/date stamp on a file other
than the one currently loaded ... any help would be greatly appreciated.

c.

--
Jul 23 '05 #1
2 1425
Christopher wrote:
Hi all,

Sorry if this is a silly question but I've been having a heck of a hard
time with it and hope somebody here can lend me a hand.

I have a site with a news pages and I'd like the navigation to include a
blinking 'NEW!' when that page has been updated within the last three
days.

It works fine for the one page (if you're on the news page, it works
great) but I can't figure out how to check the time/date stamp on a file
other than the one currently loaded ... any help would be greatly
appreciated.

c.

--


Hi Christopher,

This really would be a lot easier for you if you use serverside scripting
(like PHP).
If that is an option for you: try it.

If that is not an option.... you will have to try a really clumbersome
approach I am afraid, like loading all the possible pages in a hidden
frame, get the modificationdate, store it in a parentframe, and let JS
query it for each page...
I am not even sure if that will work, and it will be slow for sure.

Please have a look at serverside scripting.
Chances are that your current hostingprovider is offering it already with
your current account.

Hope this helps.

Good luck.

Regards,
Erwin Moller

Jul 23 '05 #2
Erwin Moller
<si******************************************@spam yourself.com> did so
declare (news:42***********************@news.xs4all.nl) :
Christopher wrote:
Hi all,

Sorry if this is a silly question but I've been having a heck of a
hard time with it and hope somebody here can lend me a hand.

I have a site with a news pages and I'd like the navigation to
include a blinking 'NEW!' when that page has been updated within the
last three days.

It works fine for the one page (if you're on the news page, it works
great) but I can't figure out how to check the time/date stamp on a
file other than the one currently loaded ... any help would be
greatly appreciated.

c.

--


Hi Christopher,

This really would be a lot easier for you if you use serverside
scripting (like PHP).
If that is an option for you: try it.

If that is not an option.... you will have to try a really clumbersome
approach I am afraid, like loading all the possible pages in a hidden
frame, get the modificationdate, store it in a parentframe, and let JS
query it for each page...
I am not even sure if that will work, and it will be slow for sure.

Please have a look at serverside scripting.
Chances are that your current hostingprovider is offering it already
with your current account.

Hope this helps.

Good luck.

Regards,
Erwin Moller

Hi Erwin, thanks ... I found a solution in the end, pretty clever really.

I run a check for a cookie on each page ... if the cookie is not present,
I place a cookie with the current URL, and redirect them to the news
page.

The news page updates the value of 'last updated' and redirects them to
the URL stored in a cookie, the whole process takes about a second the
first time people come to the site during a 24 hour period, it's an
intranet so traffic is controlled anyways but without access to PHP or
ASP ... the whole process was a bit of a pain.

THanks for your suggestion.

c.

--
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
18635
by: Dave Robinson | last post by:
I was wondering if anyone could help me with a problem I'm having. I've been using Dreamweaver to create a hotel booking system for a friend of mine, using MySQL (version 4.0.21) and PHP 5. The...
18
1750
by: Domestos | last post by:
Hi all, How do I check in a mySQL table called 'Users' on column user_name when registering a new user_name to make sure the new 'user_name' does not already exist in that column? TIA
7
7551
by: - ions | last post by:
I have created a JComboBox with its Items as a list of "M" numbers ie. M1,M2,M3.......throgh too M110 (thes are the messier objects, a catolouge of deep sky objects) the user selects of of these...
6
2382
by: RoSsIaCrIiLoIA | last post by:
Do you know how to write a self-checking program in standard C? Do I can think that if I write in a file.c static g="1234567"; in the file.exe (or file) there is in some place...
6
3656
by: Juggler | last post by:
Hi all I've written a program in VB.NET that allows the user to build quotes for installing shower enclosures. As part of the program, I've included a blank Access database. I've provided them...
7
4125
by: HIK | last post by:
Click once can be set up to pole the setup url if there is a newer version or not. I have a project which can only be deployed using a setup project. How can I create the same feature in my setup...
8
3145
by: J-P-W | last post by:
Hi, anyone got any thoughts on this problem? I have sales reps. that remotely send their data to an ftp server. The office downloads all files, the code creates an empty file, then downloads the...
10
4700
by: David | last post by:
I am trying to get this straight in my head so I can implement. I wrote a small utility some time ago in c# that utilized a handful of threads. That scenario was one main thread manually...
1
4131
by: ledneh | last post by:
I've been working on concurrency checking for an application I'm building, and a minor part of it has me slightly stumped. I've got a DetailsView that populates from an ObjectDataSource, using...
12
2675
Kelicula
by: Kelicula | last post by:
I am trying to ensure that only files of a certain type can be uploaded. Why doesn't this work?? (It's a code snippet..not the whole file) if(my $file = $q->param('avatar')){
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.