I was figuring out how to include Javascript in Smarty templates this afternoon, because you can’t include them directly. After digging around a bit, I realised that all you had to do was to include the Javascript code within {literal}{/literal} tags, like this:
{literal}
<script type="text/javascript">
var currentTime = new Date()
var year = currentTime.getFullYear()
document.write(year)
</script>
{/literal}
And once that’s done, you can use Javascript in your Smarty template. Problem solved! ![]()
Similar Posts:
- How To Fix/Solve PHPLD v_AGREERULES Smarty Template Problem
- Use Javascript to Display Random Image and Link
- How To Edit .htaccess So That SSI Include Code Will Run
- How To Use jQuery with MooTools
- How To Check All Checkboxes In A Form With Javascript


Leave a Reply