Re: xhtml 2.0 noscript

[ top posting moved ]

> > > <script type='text/javascript'>
> > > <!--

In XHTML, handled by a true XHTML browser, this will not do anything
because it really will be commented out of the code.

> > > document.write("<p><a href='javascript:sword_enlarge()'><img 

You continue to use this non-standard javascript: pseudo scheme, and
that seems to be the source of most of your problems.

> > > src='thumb_sword.gif' alt='My Sword' /></a></p>");
                                           ^
This is invalid in true HTML, although misinterpreted by browsers so as
to be ignored, but, as this code is commented out in a true XHTML browser,
there is no point in having the / there anyway.

As I noted before, if you are going to serve XHTML to non-XML browsers, like
IE6, it is almost impossible to use script elements with inline content, 
especially when they contain [X]HTML strings, so the document.write issue
tends not to arise.

> > <a href="sword.gif" onclick="annoyingPopup();"><img 
> > src="thumb_sword.gif" alt="..."/></a>

> No that won't work because it will open the image in a pop-up *and* in 
> the window.  So it just opens the image twice.

The only problem was that he forgot to include "return false" in the
onclick.

Received on Monday, 31 July 2006 06:30:28 UTC