> HTML document. Even testing javascript only, would be difficult with
> all but the simplest of scripts.
Actually, its impossible in the general case, because a basic theorem
in computer science says that it is impossible to create an algorithm
(which by definition must run in finite time) that can take an arbitrary
program in a general purpose programming language and always determine
whether the program will terminate in a finite amount of time. Obviously,
many programs can be demonstrated to do this, or demonstrated never to
terminate, but some can never be determined except by running them until
they do terminate, which will take infinite time, if, in fact, they
don't.