| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
JavaScript in Templates | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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.
__________________
Syddos Nothing is impossible, We just don't know how to do it ........Yet! Xcart 4.1.X PRO (Testing Platform: winXP Pro) Perl 5.8.7 (win32) WINAMP 1.6.3 (win32 server package. Includes the following) - phpMyAdmin v2.8.03 - MySql 5.0.21 - Apache 2.0.55 (win32) - php 5.1.4 - SQLitemanager 1.2.0 |
|||||||
#2
|
|||||||
|
|||||||
![]() 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.
__________________
Syddos Nothing is impossible, We just don't know how to do it ........Yet! Xcart 4.1.X PRO (Testing Platform: winXP Pro) Perl 5.8.7 (win32) WINAMP 1.6.3 (win32 server package. Includes the following) - phpMyAdmin v2.8.03 - MySql 5.0.21 - Apache 2.0.55 (win32) - php 5.1.4 - SQLitemanager 1.2.0 |
|||||||
#3
|
|||||||||
|
|||||||||
![]() use {literal} {/literal} inside your javascript so that Smarty will not try and parse your javascript.
![]() |
|||||||||
|
|||
X-Cart forums © 2001-2020
|