开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜