You may have encountered problems with the { and } characters in JavaScript source (also found in CSS).
These characters are used to indicate Smarty "tags" and will give you strange errors if you do not escape them.
The fix is to ensure that you surround the JavaScript or CSS code with a {literal} ... {/literal} block. This means Smarty will ignore the contents.
Example:
<script type="text/javascript">{literal}
function someJavascript() {
// ...
}
{/literal}</script>