How to escape javascript code from xml?
I can't remember of find, 开发者_如何转开发but I know there were a way using something like <[CODE
to write code inside the xml without have problems with the xml reserved symbols.. Does anyone knows?
Yep, using CDATA
- http://www.w3schools.com/xml/xml_cdata.asp
Example:
<script>
<![CDATA[
function matchwo(a,b)
{
if (a < b && a < 0) then
{
return 1;
}
else
{
return 0;
}
}
]]>
</script>
精彩评论