| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
adding java script | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
Can you add the javascript as an include and have the whole javscript as a separate file?
such as: Code:
Funkydunk
__________________
ex x-cart guru |
|||||||
#12
|
|||||||||
|
|||||||||
Quote:
The script I paste into my html's looks like this: Code:
I tried pasting it directly into the poweredby.tpl and the smarty errors came.
__________________
Xcart V4.5.5 Gold seaCOAST "Live FREE or DIE!" |
|||||||||
#13
|
|||||||
|
|||||||
Try this:
Code:
__________________
ex x-cart guru |
|||||||
#14
|
|||||||||
|
|||||||||
WOOHOO!
It worked! THANK YOU FUNKY What is the {literal} for?
__________________
Xcart V4.5.5 Gold seaCOAST "Live FREE or DIE!" |
|||||||||
#15
|
|||||||
|
|||||||
It just tells smarty to keep its mitts off the code and show exactly what is written. The problem is in the { brackets which smarty then tries to substitue code/variables etc.
Great to be of help. Funkydunk
__________________
ex x-cart guru |
|||||||
#16
|
|||||||
|
|||||||
ArmyNavy - adding javascript within a tpl
I think other have gone off at a tangent
all you have to do is add the line: {literal} at the beginning of your javascript and finish off with {/literal} what this does is tell smarty to ignore everything inside the brackets - i.e to read it (javascript) literally, Chris
__________________
Chris some carts at v4.4.5 security patched on a hardened managed unix server |
|||||||
#17
|
|||||||
|
|||||||
absolutely.
__________________
ex x-cart guru |
|||||||
#18
|
|||||||
|
|||||||
seaCost, ArmyNavy,
you can mix smarty and javascript together using the {literal} {/literal} tags describe by Ian. Here is an example; Ignore the lines begining with "//alert", they are just for variable debuging. Quote:
Regards,
__________________
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 |
|||||||
#19
|
|||||||
|
|||||||
Many thanks, Syddos. As soon as I saw that "literal" thing, I knew that's what we were looking for. More Smarty stuff...
__________________
ArmyNavy.com TM Military Surplus, Clothing, Gear, Vehicles, and Tons More. \"Tons and Tons of Surplus!\" TM |
|||||||
#20
|
|||||||
|
|||||||
I've been using PHPLiveSupport from http://www.phplivesupport.com/ on my site for quite some time for the chat functionality. Very, very easy to integrate, and I get a ton of customers online using it. I forget the fee, but the software is like $100 one-time-fee, so it's not hosted, and you don't pay a recurring fee.
If you'd like to see a live example, you can visit my site at www.aostuff.com. Take care, Nick |
|||||||
|
|||
X-Cart forums © 2001-2020
|