Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML update challenge

Status
Not open for further replies.

DB2Problem

Programmer
Oct 17, 2002
53
US
Hello ALL,

I have a flat file which contains one date field.

I need to update an HTML file with this date field by reading the file.

However, my file will be updated by a unix script every day.

I need code snippet to add in HTML file which can reflect the updated date every day.

One Important thing is that this HTML file is used at 10 places and the update of date should show up in all pages at the same time.

I can not use anything on Application Server, NO JSP's NO J2EE nothing except HTML, JavaScript and related stuff..

Any comments will help me ..

Thanks

 
If it's a plain text file, you could use a hidden IFRAME to open the file, then grab the innerHTML of the IFRAME and do whatever you want with it. You could place the code to do this in an external .js file which could be included on all 10 pages.

Adam
while(ignorance==true){perpetuate(violence,fear,hatred);life=life-1};
 
Why don't you get your unix script to write out a .js file instead of a text file?

So, if your text file (wibble.txt) contained:

Code:
Tue 03 Feb 2004

Then you could get your unix script to write out wibble.js with the following:

Code:
var dateString = 'Tue 03 Feb 2004';

Then include that on the page, and you have full access to today's date.

Hope this helps,

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top