- From: Bjoern Hoehrmann <derhoermi@gmx.net>
- Date: Tue, 09 Sep 2003 05:27:02 +0200
- To: James Alarie <jalarie@flint.umich.edu>
- Cc: html-tidy@w3.org
* James Alarie wrote: >Try this: ><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ><html> > <head> > <title>Title</title> > </head> > <body> > <script type="text/javascript"> > <!-- Hide this code from non-JavaScript browsers > max=10; > for (i=0; i<max; i++) { > document.write(i); > } > // End hiding --> > </script> > </body> ></html> From a XHTML position, this would indeed hide the script but rather from all browsers not just from non-JavaScript browsers as anything betwen <!----> is recognized as a real comment and thus ignored by the user agent. XHTML 1.0 advises to use external scripts if they contain <, & or ]]>.
Received on Monday, 8 September 2003 23:27:26 UTC