[thelist] [JavaScript] String Error Help?

Steve Clason steve at clason.org
Fri Jan 3 22:25:02 CST 2003


I'm trying to edit a Dreamweaver extension to include an xhtml
DTD as an option.  I'm just copy-catting: don't know hardly
anything about JavaScript. The file now reads:

<html>
<head>
<script TYPE="text/js" LANGUAGE="javascript">
function objectTag() {
var theDOM = dw.getDocumentDOM()
theDOM.documentElement.outerHTML = "<!DOCTYPE HTML PUBLIC
\"-//W3C//DTD XHTML 1.0 Strict//EN\"\n
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"> \n"
+ theDOM.documentElement.outerHTML;
        }</script>
</head>
<body></body>
</html>

I get a Javascript error error "unterminated string literal" on
the line (it will wrap, but it's all one line):

theDOM.documentElement.outerHTML = "<!DOCTYPE HTML PUBLIC
\"-//W3C//DTD XHTML 1.0 Strict//EN\"\n
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"> \n"

I can't for the life of me see where that string is unterminated.
This worked once, but I had to reload DW and lost it.

Can anyone help?

Steve Clason






More information about the thelist mailing list