| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Using external Javascipts | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() Hi,
I need to use some external java script, I have created a /Scripts folder in my stores directory. Created my external script and placed it in area outlined below. Named it newscipt.js then uploaded to my newly created /scripts folder. Then in my stores home.tpl I placed the following script to call the external java script like so: {literal}<script language="Javascript"src="/scripts/newscript.js"type="text/javascript"></script>{/literal} I know that any Java Scripts added to a template should be enclosed in {literal} and {/literal} but not sure where exactly to place it. I have tried: {literal}<script language="Javascript"src="/scripts/newscript.js"type="text/javascript"></script> {/literal} And even added it to the external script to no avail in both cases, like so. {literal}<!--document.write("<script language="PlacedJavaScriptHere ") //-->{/literal} And tried this too: <!--document.write({literal}"<script language="PlacedJavaScriptHere "{/literal}) //--> Any help would be appreciated on this from you code experts. Thanks in advance ![]()
__________________
Mil Mascaras Live Xcart Site #1-V- 4.1.8 Live Xcart site # 2-V 4.4.3 CDSEO Mod - Firetank MM30 - 7DANA- The bestTemplates! Linux - EWD Host Servers awesome service! AlteredCart One Page Checkout |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() - Create scripts directory under skin directory.
- Call the external java script like this: Code:
Code:
|
|||||||||
#3
|
|||||||||
|
|||||||||
![]() Quote:
Sorry for the long delay in giving you my personal thanks for your suggestions. I tried them but still cannot get it to work. I followed your instructions above or at least I think, unless I missed something? created folder "skin1/scripts" then added this code to my home.tpl <script type="text/javascript" language="JavaScript 1.2" src="{$SkinDir}/scripts/scroll.js"></script> Then created "scroll.js" and placed in the skin1/scripts folder, here my code below: {literal} <script language="JavaScript" type="text/JavaScript"> <!-- Begin var Message="scrollMessagetoappear"; var place=1; function scrollIn() { window.status=Message.substring(0, place); if (place >= Message.length) { place=1; window.setTimeout("scrollOut()",100); } else { place++; window.setTimeout("scrollIn()",120); } } function scrollOut() { window.status=Message.substring(place, Message.length); if (place >= Message.length) { place=1; window.setTimeout("scrollIn()", 100); } else { place++; window.setTimeout("scrollOut()", 100); } } scrollIn() // End --> </script>{/literal} But I still cannot get this too work, could you please assist me? thanks in advance and sorry if I am missing something here. ![]()
__________________
Mil Mascaras Live Xcart Site #1-V- 4.1.8 Live Xcart site # 2-V 4.4.3 CDSEO Mod - Firetank MM30 - 7DANA- The bestTemplates! Linux - EWD Host Servers awesome service! AlteredCart One Page Checkout |
|||||||||
#4
|
|||||||||
|
|||||||||
![]() Shipmerchant, just folow simple instruction from my fist reply.....you don't need <script language="JavaScript" type="text/JavaScript">, </script>, Begin and End in scroll.js.
What result do you expect to get from this javascript code? |
|||||||||
|
|||
X-Cart forums © 2001-2020
|