CallmasterIV Posted May 2, 2006 Share Posted May 2, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/8896-different-javascript-sitting-there-and-looping-through-a-text-file-to-do-an-action/ Share on other sites More sharing options...
GBS Posted May 3, 2006 Share Posted May 3, 2006 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,, Quote Link to comment https://forums.phpfreaks.com/topic/8896-different-javascript-sitting-there-and-looping-through-a-text-file-to-do-an-action/#findComment-32873 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.