mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 03:44:26 +02:00
Added ECMA example
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
linkend="language.function.ldelim">{ldelim}{rdelim}</link> to escape the
|
linkend="language.function.ldelim">{ldelim}{rdelim}</link> to escape the
|
||||||
individual delimiters instead.
|
individual delimiters instead.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>{literal} tags</title>
|
<title>{literal} tags</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -35,6 +36,26 @@
|
|||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
|
<example>
|
||||||
|
<title>Javascript = ecma</title>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
|
<script language="JavaScript" type="text/javascript">
|
||||||
|
{literal}
|
||||||
|
function myJsFunction(name){
|
||||||
|
if(name){
|
||||||
|
alert('The servers name is: ' + name);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
<a href="javascript:myJsFunction('{$smarty.server.SERVER_NAME}')">Click here for Server Name</a>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
See also
|
See also
|
||||||
<link linkend="language.escaping">Escaping Smarty Parsing</link>.
|
<link linkend="language.escaping">Escaping Smarty Parsing</link>.
|
||||||
|
Reference in New Issue
Block a user