![]() |
Javascript function problem in template
I've got this code inside one of my templates:
Code:
<script language="javascript" type="text/javascript"> For some reason, when I look at the source code for the page, this is what is there: Code:
<script language="javascript" type="text/javascript"> Any idea why it is leaving out the { and } and everything in between? |
Re: Javascript function problem in template
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 |
Re: Javascript function problem in template
Surround your JS with {literal} tags:
{literal} Javascript here {/literal} That keeps Smarty from reading it as Smarty :) |
All times are GMT -8. The time now is 02:07 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.