| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Javascript function problem in template | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I've got this code inside one of my templates:
Code:
For some reason, when I look at the source code for the page, this is what is there: Code:
Any idea why it is leaving out the { and } and everything in between?
__________________
CreativeArc --------------- X-Cart Pro Version: 4.1.8 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() The brackets {} are being interpreted as smarty tags - it is looking for smarty variables/code inside them.
You can maybe solve the problem by putting the function in separate .js file or adding it to the existing XCART js file? Maybe something like: <script type="text/javascript" language="JavaScript1.2" src="my_scripts.js"></script> then adding your functions to my_scripts.js
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#3
|
|||||||
|
|||||||
![]() Surround your JS with {literal} tags:
{literal} Javascript here {/literal} That keeps Smarty from reading it as Smarty ![]()
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|