Our Updated Ticker Design Specification
Let's outline our design criteria for the new ticker implementation:
- It should run on as many platforms as possible.
- Perhaps the code can be simpler than before.
- Passing the data to the ticker should be the most efficient technique and not be limited by the workflow constraints imposed by BBC News Online.
- Can we add any functional enhancements to the ticker?
- Can we find a better event detection mechanism that does not crash browsers with
- Can we place some HTML inside the
IFRAMEtag that avoids the need for the
- Pose and answer the question "Does DOM standardization really help us in solving a problem like this?"
In our new implementation, lets also simplify things by removing the background graphic and see if we can streamline the main
Passing Data to the Ticker
Before proceeding with the coding of our new ticker design, we need to choose a means by which we shall import the story headline and URL into the scripting environment.
myVar = getURL('http://www.abc.com/mydata.txt');
Microsoft provides some non-portable solutions to this problem with IE 5, such as the download behavior or an ActiveX control for loading content. Both have the 'same server' restriction but are otherwise fully functional to load a text file into a string variable. However, neither of them work in Netscape or Opera.
There are several portable approaches, each having advantages and disadvantages:
- Hidden fields inside a form
- Textual content in a hidden frame or layer
- Building a document structure from nested DIV blocks
- DOM navigation of document structures
- XML data islands
We can experiment with some examples that illustrate each of these to discover their limitations.
The limiting factor with hiding fields inside a form is that there is no structure implied
and it is simply a one-dimensional array of strings. Another disadvantage (although you may not consider
it a problem), is that it must be embedded within the same page. You can add structure by embedding
mark-up within the data, but that needs to be parsed out somehow. You could carefully hide executable
eval() function to call it into your script. Here is
block at the top of the page:
This is fairly portable. The insertion in
DIV blocks limits how far back in
browser versions you can go, but pulling things out of hidden form fields should work with very
old browsers since access to forms data and the
eval() function have been around for a
Created: November 8, 2001
Revised: November 8, 2001