Is the following valid XHTML 1.0 Transitional?

Posted by willem on Stack Overflow See other posts from Stack Overflow or by willem
Published on 2010-06-17T12:59:10Z Indexed on 2010/06/17 13:03 UTC
Read the original article Hit count: 214

The w3c validator service complains that the following html is invalid. It does not like the ampersand(&) in my javascript. But ampersands are allowed in javascript strings, aren't they?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Page Title</title>
    </head>
    <body>
        <script type="text/javascript">


           function search(query) {
             redir = "http://search.mysite.com/search?s=FIN&ref=&q=" + query;
             window.location.href = redir
             return false;
            }
        </script>

        <span>This is all valid HTML</span>

    </body>
</html>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about ampersand