SVG Clock: Compatibility?
So we have a clock, let's see it tick! All right, here you go! Served as image/svg+xml no less. What? It isn't doing anything?
This is where the tragic part comes in. There are at 15 different implementations of the SVG markup language (and its derivatives) at the time of writing. The two I use are the Adobe SVG Viewer, and Mozilla's native SVG support. Odds are that you're using Adobe's product at the moment, and that you got Javascript error messages on the previous link. This is because while this viewer has among the best support for SVG, it lacks somewhat in its DOM implementation.
To get around this, it is as easy as using setAttribute() instead attr.baseVal.value. Still correct, but insignificantly less efficient than the previous method (converting a string to a number for the renderer). Here is an Adobe-friendly version of the clock: ASV version
As for Mozilla, its implementation is lacking in some of the more complicated elements, but it has excellent DOM support. Unfortunately, it doesn't recognize a <script> element in the SVG namespace. The workaround is to say xmlns="http://www.w3.org/1999/xhtml" in the script tag in order to have it execute its contents. Other than that, everything works: Mozilla version
Because the Adobe SVG Plugin works for most browsers, the script itself remains very compatible, assuming that the ASV-friendly modification is used.
Back: The Nitty Gritty, Next: Conclusion