JavaScript in Templates
Hi,
I would like to place a JavaScript script into the <HEAD> section of a page, I know "Smarty" will produce errors, if I just add it in the normal way (<script> <-- code --> </script>). Is there a way to prevent smarty from producing errors, or should I create a JavaScript file (name.js) and call my script into the template page as an external file? Example below <!-- <SCRIPT language=javascript1.4 src="http://www.stackofgoods.com/dir/myJavaScritpFile.js"></SCRIPT> //--> If anyone has another way Please let me know. |
JavaScript in Templates - Solved
Problem solved. I used the method below between the <BODY> </BODY> tags of the template, to call my JavaScript file and run the script.
Quote:
Thanks for looking. |
use {literal} {/literal} inside your javascript so that Smarty will not try and parse your javascript.
:arrow: http://smarty.php.net/manual/en/language.function.literal.html |
All times are GMT -8. The time now is 02:45 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.