![]() |
|
![]() |
||
![]() |
![]() |
|
[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date] Re: xhtml 2.0 noscript
From: Laurens Holst <lholst@students.cs.uu.nl>
Date: Tue, 25 Jul 2006 16:07:13 +0200 Message-ID: <44C62591.2080409@students.cs.uu.nl> To: Orion Adrian <orion.adrian@gmail.com> Cc: www-html@w3.org Orion Adrian schreef: >> <?xml version="1.0" encoding="UTF-8"?> >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd "> >> <html xmlns="http://www.w3.org/1999/xhtml " lang="en" xml:lang="en"> >> <head> >> <title>No script alternative</title> >> <style type="text/css"> >> .secret {display: none} >> </style> >> <script type="text/javascript"> >> function go() { >> document.getElementById('noscript').className="secret"; >> document.getElementById('hasscript').className="public";; >> return true; >> } >> </script> >> </head> >> <body onload='go();'> >> <h1>A noscript alternative</h1> >> <p id='noscript'>This document has no script</p> >> <p id='hasscript' class='secret'>This document has script</p> >> </body> >> </html> > > noscript is a convenience. That's all. While it's possible to do as > you suggest, noscript is much easier to read and much cleaner. It > produces a nicer output for search engines and it's a standard way of > saying what you just put there. It also doesn't rely on CSS which may > also not be supported. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd "> <html xmlns="http://www.w3.org/1999/xhtml " lang="en" xml:lang="en"> <head> <title>No script alternative</title> <style type="text/css"> .noscript .noscript {display: none} </style> <script type="text/javascript"> function go() { if (document.XMLHttpRequest) { document.documentElement.className = 'noscript'; document.body.appendChild(document.createElement('p').appendChild(document.createTextNode('This document has script'))); } return true; } </script> </head> <body onload='go();'> <h1>A noscript alternative</h1> <p class="noscript">This document has no script</p> </body> </html> Then. ~Grauw -- Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Laurens Holst, student, university of Utrecht, the Netherlands. Website: www.grauw.nl. Backbase employee; www.backbase.com.
|
|
||||||||||||||||