Matt said:
It would be more correct to say that on the web, it does not work
with all browsers,
Surly it does not work with all browser whether on the web or not. The
web is just the place where it can expect to encounter all browsers (or
at least stand a chance of encountering them).
but most likely does work for the majority of
users. Also, it appears to degrade gracefully (not causing any
problems in browsers where it doesn't work) which is exactly what
we'd want.
Well, we have a thread about monitoring the mouseup event outside of the
window/document, and that definitely does not work on many browsers, and
then only under some circumstances (only when dragging in IE, for
example).
The code under discussion does make a reasonable attempt at clean
degradation, but it is a long way from being cross-browser, reliable or
good. And some of the implementation details make me think that it could
be extremely problematic on Safari or Konqueror (to name but two) with
the script partly running and then erroring mid process due to the use
of object-inference browser detection instead of the feature detection
that it almost achieves. That type of uncontrolled failure mid flow is
likely to undo the good work put into clean degradation by leaving the
page in an intermediate state that may not be nearly as viable as the
original HTML.
So, in summary, it appears to be a fantastic solution, IMO.
If you understood what the script was doing you would not be attaching
"fantastic" to it as a label. It is an above average script with some
serious design flaws and as a result should only be expected to exhibit
planned behaviour on the limited test-set of browsers stated in its
documentation.
It is actually a bit disappointing as a product of its author as his
vector graphics library is a really good implementation of efficient
line and arc drawing algorithms in javascript. Which contrasts horribly
with a script that even features an eval-ed dot notation property
accessor.
Richard.