views:

55

answers:

1

Here's what I tried... I put this in a file called <mySbtBasedProjdir>/src/main/webapp/static/simpleForLoop.html

<lift:surround with="default" at="content">

Why is this a problem in liftweb?

<script type="text/javascript">
  var i=0;
  for (i=0;i<=5;i++) {
    document.write("The number is " + i);
    document.write("<br />");
  }
</script>

</lift:surround>

The error I get starts with:

scala.xml.dtd.ValidationException: :5:14: name expectednet.liftweb.util.PCDataXmlParser.reportSyntaxError(PCDataMarkupParser.scala:174)
+2  A: 

You need to enclose it inside CDATA tags I think

<![CDATA[
<script etc ...
</script>
]]>

So the parser ignores it.

BGerrissen