[sclug] XHTML Question

Roland Turner raz.fpyht.bet.hx at raz.cx
Sat Oct 25 09:05:44 UTC 2003


On Fri, Jun 20, 2003 at 08:44:45AM +0100, Matthew Browning wrote:

> Its an interesting question since the page `becomes' valid when it is 
> actually used so is clearly in the spirit of XHTML; in this sense, is 
> it that different to a document containing PHP scripting - you can't 
> validate it as is but the final output is (might be) compliant?

Similar, but not the same; in the PHP case, it is executed in a
server environment where the author has (or has access to) a
great deal of control and predictability about how it will
behave. This is not the case for Javascript where the script
interpreter may be:

- Buggy

- A different version to that/those tested by the author

- Disabled

- Prevented from operating by an in-line proxy that strips
  Javascript from incoming pages in order to protect the integrity
  of the machines behind a firewall.

So while it is possible to verify that the PHP script will
generate valid data for a given set of test URLs, this is not the
case for (client-side) Javascript as it becomes neccessary to
make (simplifying, frequently false) assumptions about the user's
browser and environment.

A related difference is that the PHP interpreter runs once and
generates one page for transmission; this page is either valid or
it is not. In the (client-side) Javascript case, this is not
true; the Javascript interpreter can alter the page (and thus
impact its XHTML validty) continually for as long as the page is
in the user's browser.

- Raz



More information about the Sclug mailing list