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

Home Posts Topics Members FAQ

Is there a way to do this?


Hi,

I am new to Javascript and HTML, but I know C. From
C program, I generate an HTML file and upload it to
my home page every 2 to 10 seconds. At the browser side,
I want to monitor the change in the HTML file content
or date stamp and dowload it if it has been changed.
Also, will be any conflict in accessing same file between
the upload and the download?

Thanks.
Jul 23 '05 #1
5 1007
New to PHP wrote on 19 feb 2005 in comp.lang.javascript:
I am new to Javascript and HTML, but I know C. From
C program, I generate an HTML file and upload it to
my home page every 2 to 10 seconds. At the browser side,
I want to monitor the change in the HTML file content
or date stamp and dowload it if it has been changed.
First, you call yourself "New to PHP",
but I will dismiss that as inconsequencal on this javascript NG.

Then you ask if you can do that with javascript.

Javascript can be executed on the server [on an ASP platform] or on the
browser. I suppose you mean the latter.

Well no, you cannot know on clientside if a file on serverside has
changed unless you download the file or the header. The header could
inform you of size and date of creation.
Also, will be any conflict in accessing same file between
the upload and the download?


Between? I don't understand. Do you mean:

Will the file temporarily be unavailable to download during upload?

Yes, but there are many other reasons on the net that produce the same
shorttime phenomenon, so you will have to accomodate for that.

==============

If you want the page coninuous on the browser, the best way seems to me
to update the same every so many seconds using a <meta refresh> construct
or a javascript containing a location.reload() that fires unter a
setTimout().

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #2
Sorry for identity issue. I forgot to change it in .emacs
since I am using GNUs.

Also, I didn't state clearly. So, let me try again.
I wrote a server-client game using TCP/IP and C.
Every step of the game, I create a very same HTML file and using
ftp, I download it to my homepage to allow people to watch the game.
On the browserside, I want to write a Javascript so that the
browser can reload it. So, your suggestion is to use timer to
reload the file or the header every second or so.

I will give it a try.

Thanks.
"Evertjan." <ex**************@interxnl.net> writes:
New to PHP wrote on 19 feb 2005 in comp.lang.javascript:
I am new to Javascript and HTML, but I know C. From
C program, I generate an HTML file and upload it to
my home page every 2 to 10 seconds. At the browser side,
I want to monitor the change in the HTML file content
or date stamp and dowload it if it has been changed.


First, you call yourself "New to PHP",
but I will dismiss that as inconsequencal on this javascript NG.

Then you ask if you can do that with javascript.

Javascript can be executed on the server [on an ASP platform] or on the
browser. I suppose you mean the latter.

Well no, you cannot know on clientside if a file on serverside has
changed unless you download the file or the header. The header could
inform you of size and date of creation.
Also, will be any conflict in accessing same file between
the upload and the download?


Between? I don't understand. Do you mean:

Will the file temporarily be unavailable to download during upload?

Yes, but there are many other reasons on the net that produce the same
shorttime phenomenon, so you will have to accomodate for that.

==============

If you want the page coninuous on the browser, the best way seems to me
to update the same every so many seconds using a <meta refresh> construct
or a javascript containing a location.reload() that fires unter a
setTimout().

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #3

On Sat, 19 Feb 2005 15:03:44 GMT New to PHP wrote:

Hi, I am new to Javascript and HTML, but I know C. From
C program, I generate an HTML file and upload it to
my home page every 2 to 10 seconds. At the browser side,
I want to monitor the change in the HTML file content
or date stamp and dowload it if it has been changed.
Also, will be any conflict in accessing same file between
the upload and the download? Thanks.

Why are you uploading every 2 to 10 seconds?
You upload the html file to the server and leave it alone.
Nobody but you can change the content so don't worry about it.
You can add a bit of coding to show on the page when it was last modified.
Once the file is on the server, nothing more needs to be done on your end.
Jul 23 '05 #4
Richard wrote:
On Sat, 19 Feb 2005 15:03:44 GMT New to PHP wrote:
Hi,


I am new to Javascript and HTML, but I know C. From
C program, I generate an HTML file and upload it to
my home page every 2 to 10 seconds. At the browser side,
I want to monitor the change in the HTML file content
or date stamp and dowload it if it has been changed.
Also, will be any conflict in accessing same file between
the upload and the download?


Thanks.


Why are you uploading every 2 to 10 seconds?
You upload the html file to the server and leave it alone.
Nobody but you can change the content so don't worry about it.
You can add a bit of coding to show on the page when it was last modified.
Once the file is on the server, nothing more needs to be done on your end.


Once again, you show actions of why people refer to you as RtS since
your answer is no where near what the OP needed to do. Had you bothered
to actually *read* the post, you would know that. Try reading it again.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #5
JRS: In article <cv*********@news4.newsguy.com>, dated Sat, 19 Feb 2005
15:57:08, seen in news:comp.lang.javascript, Richard <An*******@127.001>
posted :
On Sat, 19 Feb 2005 15:03:44 GMT New to PHP wrote:
I am new to Javascript and HTML, but I know C. From
C program, I generate an HTML file and upload it to
my home page every 2 to 10 seconds. At the browser side,
I want to monitor the change in the HTML file content
or date stamp and dowload it if it has been changed.
So you need to advise users on setting browser caching policies.
Also, will be any conflict in accessing same file between
the upload and the download?


That depends on the coding of the server. A well-designed server will
IMHO protect against such problems, by uploading into a temporary file
name and not swapping horses in mid-serve.
Why are you uploading every 2 to 10 seconds?
There's a fairly obvious explanation; the content keeps changing.
You upload the html file to the server and leave it alone.
The desired content keeps changing.
Nobody but you can change the content so don't worry about it.
You do not know that; the OP may be part of a team who can all upload.
It is likely to be so; but the OP knows better than you do.
You can add a bit of coding to show on the page when it was last modified.
Your intention is unclear - where does the code go? If you mean
javascript on the page, then the OP should be warned about the perils of
interpretation there, as those who have used the newsgroup FAQ should
know (if concerned with such things). If the visible date-stamp is
generated by the C in unambiguous form (see ISO 8601) there should be no
problem; but FFF should be avoided.
Once the file is on the server, nothing more needs to be done on your end.

To allow for those of limited ability, the OP should really have
distinguished more clearly between the person responsible for uploading
and the person responsible for downloading : they may on occasion be the
same person, but the roles are distinct.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #6

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

Similar topics

4
3328
by: James | last post by:
I have a from with 2 fields: Company & Name Depening which is completed, one of the following queries will be run: if($Company){ $query = "Select C* From tblsample Where ID = $Company...
5
2738
by: Scott D | last post by:
I am trying to check and see if a field is posted or not, if not posted then assign $location which is a session variable to $location_other. If it is posted then just assign it to...
2
2711
by: Nick | last post by:
Can someone please tell me how to access elements from a multiple selection list? From what ive read on other posts, this is correct. I keep getting an "Undefined variable" error though... Form...
2
2528
by: Alexander Ross | last post by:
I have a variable ($x) that can have 50 different (string) values. I want to check for 7 of those values and do something based on it ... as I see it I have 2 options: 1) if (($x=="one") ||...
0
3258
by: Dan Foley | last post by:
This script runs fine, but I'd like to know why it's so slow.. Thanks for any help out there on how i can make it faster (it might take up to 5 min to write these 3 export files whith 15 records...
5
3193
by: Lee Redeem | last post by:
Hi there I've created abd uploaded this basic PHP script: <html> <head> <title>PHP Test</title> </head> <body> <H1 align="center">
5
10035
by: christopher vogt | last post by:
Hi, i'm wondering if there is something like $this-> to call a method inside another method of the same class without using the classname in front. I actually use class TEST { function...
6
2653
by: Phil Powell | last post by:
Ok guys, here we go again! SELECT s.nnet_produkt_storrelse_navn FROM nnet_produkt_storrelse s, nnet_produkt_varegruppe v, nnet_storrelse_varegruppe_assoc sv, nnet_produkt p WHERE...
1
2182
by: Michel | last post by:
a site like this http://www.dvdzone2.com/dvd Can you make it in PHP and MySQL within 6 weeks? If so, send me your price 2 a r a (at) p a n d o r a . b e
11
3135
by: Maciej Nadolski | last post by:
Hi! I can`t understand what php wants from me:( So: Cannot send session cache limiter - headers already sent (output started at /home/krecik/public_html/silnik.php:208) in...
1
7098
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
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5682
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
5084
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
4745
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
3232
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
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
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.