- From: Mark Birbeck <mark.birbeck@x-port.net>
- Date: Sat, 29 Jul 2006 17:27:28 +0100
- To: magick <jasper.magick@gmail.com>
- Cc: www-html@w3.org
Hi Jasper, > You all are pissing me off. Jeez...you been on holiday with Bjoern? > In clear and plain English. YES OR NO. > Can you use <noscript> in xhtml2? > You still have not answered by questions. Everytime I write to W3C, my > topic always gets hijacked and turns into a discussion about something > else, rather than address the original question, MY question. Sounds like one of my two year old son's tantrums. Just out of interest, where did you get the idea that these lists are here to serve you individually? As it happens, I think your question has been answered pretty clearly, and it sounds to me more like you disagree with the answer, rather than it hasn't been answered. I'm sorry that you disagree, but hey, that's life. If you're going to throw a tantrum every time you don't like the answer to something you might be better off avoiding these lists. I certainly don't think it's reasonable behaviour to get rude and throw your toys out of the pram. Anyway, let's get back to your issue since it's sure to affect other people. > ************************************** > > And here is a very good example why you may want to use it: > > Let's say you have this > > <a href='javascript:history.go(-1)'>Go back to the page you just left</a> > > In your document, well anyone with JavaScript disabled or not supported > will just get a link that doesn't do anything. Annoying those people. > So what do we do, it's simple. > > <script type='text/javascript'> > <!-- > document.write ("<a href='javascript:history.go(-1)'>Go back to the page you just left<\/a>") > --> > </script> > <noscript><!--NOOP--></noscript> > > Now if someone has JS enabled, they'll see the link, if not they see > nothing. It's the best of both worlds. That is an example of using <noscript>, that's true, but there is no *need* for this. Your use of document.write() is to create something in the document that would only be accessible to someone who has script enabled, but that can just as easily be done like this: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> function jssupported() { var oEl = document.getElementById('jssupported'); oEl.style.display = "block"; return; } </script> </head> <body onload="jssupported();"> <div id="jssupported" style="display: none;"> <!-- put stuff in here that requires script --> </div> <!--Jasper's NOOP--> </body> </html> Note that this is completely generalisable, and easier to maintain than lots of document.write() statements. It also works in the HTML 'incremental loading' model, as well as the XML->XHTML model I described earlier. There are plenty of other ways this could be done, but the key point is that we therefore don't *need* the <noscript> element in an *XHTML* browser. I would say that it *was* needed in an *HTML* browser though, since you might have this: <body> <p>Hello Jasper, welcome back to your online banking.</p> <script ...> document.write("Your balance is:" + nBalance); </script> <p>Hope that helps.</p> </body> In this situation the *initial* appearance of the document will be different, depending on whether you have script enabled or not, and so there is no other alternative but to have the <noscript> element. This is not the case in XHTML, since there is no equivalent of document.write() modifying the document as it is loaded. Regards, Mark -- Mark Birbeck CEO x-port.net Ltd. e: Mark.Birbeck@x-port.net t: +44 (0) 20 7689 9232 w: http://www.formsPlayer.com/ b: http://internet-apps.blogspot.com/ Download our XForms processor from http://www.formsPlayer.com/
Received on Saturday, 29 July 2006 16:27:37 UTC