File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Detecting Data Change in JS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Detecting Data Change in JS" Watch "Detecting Data Change in JS" New topic

Detecting Data Change in JS

Adam Nottingham

Joined: Mar 04, 2010
Posts: 6
My current project is something to track print usage. After logging into the printer's web interface and looking at the logs I realized that it was a rolling log with a fixed number or rows. Therefore, once it is full the bottom element falls off and one is added to the top something like a queue. While looking at the source for the page however, I noticed that the actual data was store in the JScript source instead of being recorded. I have made the line I'm talking about bold down below.

Basically what I want to do is, as soon as the online log is updated I want to be able to pull that info from the page and save it to another file on my hard drive. How can I go about automating this so that it will watch the page and automatically pull the information?

I have added the part of the .html containing the appropriate script.


Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63547

Please UseCodeTags.

[Asking smart questions] [About Bear] [Books by Bear]
Adam Nottingham

Joined: Mar 04, 2010
Posts: 6
Ah I apologize. Thanks.

The applicable line that was in bold is now on line 28.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Why don't you just use a client application to fetch the url and read the file? Simple reg exp can grab it, rip it apart, and you can save it.

Seems pretty weird you do not have a log on the server you can tail in the first place.


I agree. Here's the link:
subject: Detecting Data Change in JS
It's not a secret anymore!