I suspect that you may be inserting the java code in the wrong place. It should be placed in the body section. They can`t all be faulty.
Have a look at a page of mine with a scrolling text in the task bar.
Then have a look at the source by clicking View, then source.
Lots of clock scripts, and I have just tried a couple that worked fine.