Jump to content

Archived

This topic is now archived and is closed to further replies.

CallmasterIV

Different... Javascript Sitting there and looping through a text file to do an action?

Recommended Posts

Appologies all, as I am not familar with java techniques at all.
At least i can do a popup etc. :-)

Is there a way, to have a javascript loop through a text file.. somewhere on the same machine as the webserver is..which is expected to be empty.

as long as thats the case, the script does not need to action.
as soon as there is a line..
the script reloads the page with different content (possibly the contents of the text file), allows to remove the lines (via a form button as maybe confirmation) and go back to a looping state?

basically i expect on my server in a folter that other scripts add snmp messages from host who have problems. a browser will display a permanent site. (actually so far that works...)
now a box has a problem, writes an "event", my site -located script picks the messgae, and lets the screen maybe fade red blink and sound until the event has been confirmed (the input submit button thing)
onclick, get rid of the content in the text file (or the confirmed line ideally), and keep on ..maybe not looping...rather monitor the write access?

.....any help from anybody? a search on filehandling dindt bring back much, so...

it doesnt actually have to be in javascript..but it think thats the easiest way..

I should take a less stressful jop. probably on an oil-rig or as stuntman..

CallmasterIV

Share this post


Link to post
Share on other sites
Hi there,

<<Is there a way, to have a javascript loop through a text file..
<Hmm,... not using pure javascript, but I guess using Ajax/JPSpan you can get it works, yep,,

<<the script reloads the page with different content (possibly the contents of the text file), allows to remove the lines (via a form button as maybe confirmation) and go back to a looping state
<My idea is that your project seems quiet difficult to script just using javascript/Ajax/JPSpan,,
I think an easier way would be to use php for all the text manipulations,

<<now a box has a problem, writes an "event", my site -located script picks the messgae
<that part could be done also in php

<<, and lets the screen maybe fade red blink and sound until the event has been confirmed (the input submit button thing)
<& that one in javascript,

So,,, [b]a lot of work[/b] to plan,... :)

Hoping it helps,

l8tr,,

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.