Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 01330ec25d
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (41 sloc) 1.163 kb
__NAME__ purpose
return a string for use in JavaScript, quoted and with variables substituted
__END__
__NAME__ synopsis
&TAG_CONTAINER_0_0;
__END__
__NAME__ see also
jsqn
__END__
__NAME__ author
&mheins;, &ICDEVGROUP;
__END__
__NAME__ description
<tag>jsq</tag> tag quotes (escapes) strings and performs basic variable
substitution, for use in JavaScript code blocks.
</para><para>
This is mostly used for long strings which are hard to prepare manually.
</para><para>
<tag>jsquote</tag> is an alias for <tag>jsq</tag>.
__END__
__NAME__ example: Basic example
Here's an example of JavaScript code and the output it would generate,
once expanded by Interchange:
<programlisting><![CDATA[
<script>
var astring = 'just an insert';
var somevar = [jsq] Big long string you don't
want to have to quote for JS, and you want to
insert the variable $astring.[/jsq];
</script>
]]></programlisting>
Expands to:
<programlisting><![CDATA[
<script>
var astring = 'just an insert';
var somevar = " Big long string you don't" +
' want to have to quote for JS, and you want to' +
' insert the variable ' + astring + '.';
</script>
]]></programlisting>
__END__
Jump to Line
Something went wrong with that request. Please try again.