Jump to content


Photo

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


  • Please log in to reply
1 reply to this topic

#1 CallmasterIV

CallmasterIV
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 02 May 2006 - 03:04 PM

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

#2 GBS

GBS
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 03 May 2006 - 08:31 AM

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,,, a lot of work to plan,... :)

Hoping it helps,

l8tr,,
Sorry for my english,... I do my best, but sometimes,...
1st intention: understand the problem
2nd intention: try to solve it
3rd intention: try to understand how to solve it :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users