<script language="JavaScript" type="text/javascript">
{literal}
function myJsFunction(name, ip){
alert("The server name\n" + name + "\n" + ip);
}
{/literal}
</script>
<a href="javascript:myJsFunction('{$smarty.server.SERVER_NAME}','{$smarty.server.SERVER_ADDR}')">Click here for the Server Info</a>
例 7-27. テンプレート内での css style
{* included this style .. as an experiment *}
<style type="text/css">
{literal}
/* this is an intersting idea for this section */
.madIdea{
border: 3px outset #ffffff;
margin: 2 3 4 5px;
background-color: #001122;
}
{/literal}
</style>
<div class="madIdea">With smarty you can embed CSS in the template</div>