I am really starting with Smarty and I do not understand this fact:
if I put the next code inside my template index.tpl
<script type="text/javascript">
function toAlert() {
alert('{$text}' );
}
</script>
I can access to the function toAlert and show the content of Smarty variable {{$text}}, but if I put this code into a js file lije javascript.js and I try to access it by putting into de template the link:
I cannot access to the function as well.
Can anyone tell me why or help wher can I find this specific info? thank you!!
var data = { text: '{$text}', other: '{$other}'};Then you can accessalert(data.text + ' ' + data.other);