This project is read-only.

mdo:j[s]-encode ( string )

  • mdo:j-encode encodes string to javascript literal constant.
  • mdo:js-encode encodes string to javascript literal constant and adds quotes around.


<script type="text/javascript">
  var articleText = {{mdo:js-encode($article/Text)}};
</script>

Or, you can use {j{xpath}} syntax:

<script type="text/javascript">
  var articleText = {j{$article/Text}};
</script>


Last edited Jan 12, 2011 at 6:38 AM by findy, version 10

Comments

No comments yet.