Hi, why not to use CDATA section:
<script> <![CDATA[ function pr_single_select(id, reset_all) { alert("OK"); if (reset_all == true) { for ( i = 0; i < document.forms.frmProducts.length; i++) { if (document.forms.frmProducts.elements[i].type == 'checkbox') { document.forms.frmProducts.elements[i].checked = false; } } } } ]]> </script> Jirka Allen Guo napsal(a): > Hi All, > > I use javascript in my html template file like this. > 15 <script> > 16 function pr_single_select(id, reset_all) { > 17 alert("OK"); > 18 if (reset_all == true) { > 19 for ( i = 0; i < document.forms.frmProducts.length; i++) { > 20 if (document.forms.frmProducts.elements[i].type == 'checkbox') { > 21 document.forms.frmProducts.elements[i].checked = false; > 22 } > 23 } > 24 } > > > But I always got exception below. > Failure parsing template context:WEB-INF/shop/ProductList.html: The > content of elements must consist of well-formed character data or markup. > > location > context:WEB-INF/shop/ProductList.html, line 19, column 23 (see above) > > .... > > org.xml.sax.SAXParseException > The content of elements must consist of well-formed character data or > markup. > > Why? This is my first use javascript to my html tempplate file. what > should i do ? > > Thanks > Allen Guo > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Jiří Mareš (mailto:[EMAIL PROTECTED]) ČSAD SVT Praha, s.r.o. (http://www.svt.cz) Czech Republic --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]