Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript/XML question

Status
Not open for further replies.

FJC148

Technical User
May 14, 2003
20
GB
This question is a little bit long winded so please bear with me. The retail company I work for has a till system in-store that can display an HTML page with a list of daily transaction related details. The most important of these is the total sales figure for the day.

The till software provides the figures to a standard XML page and they are dynamically updated throughout the day. The HTML page on the till in turn displays these figures with it automatically refreshing every couple of minutes or so.

There is one XML page for each day of the week. These pages are all the same except for their title and the figures that they have inside.

Basically I want to create a weekly sales figure that can be viewed. If possible I want to have a bit of Javascript to grab the Sales total (the XML tag is SALESTOTAL) figures from each of these 7 daily XML pages, display the individual sales total figures(or perhaps just those that currently have a value), and most importantly also calculate and display the sum total of all these figures. Preferably this would update on a refresh,and be displayed in a part of an HTML page specified rather than just at the top.

I'm quite new to Javascript so if possible could someone please tell me if it can be done? If so I'd be grateful for any advice on how to go about doing it, an example of the code needed, or to be pointed to a useful tutorial that may help.

Thanks

FJC
 
I think that you are going to need to check into server-side languages (ColdFusion, PHP, ASP) to do what you are trying to do.

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
zen.gif

 
I have read one tutorial that shows you how to get some data from XML into HMTL using Javascript. I've played around with it so that i can grab the data from multiple XML files:


The catch is it displays them in an input box and I need to click to get the figure. Is there a way to display this data just as normal text/numbers, and to automatically add the figures together so that a sum total can be viewed?

Also when the XML tag contains no data there is an error. Does anyone know if there is a way round this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top