Sounds like fun, huh?
Well, quite simply, I need to make a ticker (see bbc news). Simple enough but the catch is, the whole site needs to be able to continue if the IT team came out a meeting and were killed by a bus. So, I am writing a back-end via php etc. Unfortuantly, Js cant read text files, but it can read xml. Therefore, I had the idea, I'll use this:
Php writes xml
xml imported into Js
Js displays ticker
Simple. Told you so. However, as ever, there is a catch. I'm not sure how to set the length of the array. My thoughts were to make a field in the xml that would contain the number of items the array requires to hold. Couldn't think of a better way. Anyways, I nt sure how to get the xml into the Js array.
What I have: Js Ticker, Js file for reading xml (both IE and FF etc)
Anyways, the above is really for background, just in case there was a better way. However, I couldn't find it, so assistance in showing me how to create the array according to the bit in the xml file would be great.
Cheers,
Domestic
Js, XML, and arrays
Started by domestic, Feb 06 2008 04:37 PM
4 replies to this topic
#1
Posted 06 February 2008 - 04:37 PM
.

Programming Languages: Java, VB6, VB2005 (.NET2)
Web Languages: HTML, CSS, JS
Website: http://abdn.ac.uk/~u41am6
Opportunity is missed by most people because it is dressed in overalls and looks like work.

Programming Languages: Java, VB6, VB2005 (.NET2)
Web Languages: HTML, CSS, JS
Website: http://abdn.ac.uk/~u41am6
Opportunity is missed by most people because it is dressed in overalls and looks like work.
|
|
|
#2
Posted 08 February 2008 - 04:01 PM
I didn't finish reading your thread because you said "write to a file". Why would you write to a file when you can read/write with PHP? Second, why not just use AJAX? Create a PHP file in the backend. The front end will consist of JavaScript executing a PHP file (hey, AJAX!) that reads the file again.
#3
Posted 08 February 2008 - 07:22 PM
tickers are js things. its how they continually update what you see. php wont do this for me, so I would still need to get the information into a js array.
.

Programming Languages: Java, VB6, VB2005 (.NET2)
Web Languages: HTML, CSS, JS
Website: http://abdn.ac.uk/~u41am6
Opportunity is missed by most people because it is dressed in overalls and looks like work.

Programming Languages: Java, VB6, VB2005 (.NET2)
Web Languages: HTML, CSS, JS
Website: http://abdn.ac.uk/~u41am6
Opportunity is missed by most people because it is dressed in overalls and looks like work.
#4
Posted 08 February 2008 - 10:12 PM
If you create an asynchronous connection between your JavaScript file and your PHP file, every time your JavaScript file calls the PHP script, the PHP script will execute and update the information.
#5
Posted 27 February 2008 - 02:49 AM
ok:)


Sign In
Create Account


Back to top









