Jump to content

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


CallmasterIV

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
Link to comment
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,,
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.