| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Calling external JS | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hi guys,
I'm attempting to insert a vertical image scroll into customer/home.tpl. It works when I place it directly within home.tpl, but then I obviously have a very large section of javascript on my home page. Hence I have been trying to call upon the file externally, with no luck. I've read all the posts I could find on this topic, but so far nothing seems to work. script is called scroll.js, and is located skin1/scroll.js Quote:
customer/home.tpl: Quote:
I've tried pasting the {literal} tags within scroll.js instead, but that doesn't work either. Any help would be greatly appreciated. Thanks .... Chris
__________________
X-Cart version 4.0.17 |
|||||||
#2
|
|||||||
|
|||||||
![]() Put the .js file in your skin1 directory and call it like this:
<script language="JavaScript1.2" src="{$SkinDir}/scroll.js"></script>
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
![]() Hi Balinor,
Thanks for the quick reply. Unfortunately I've tried that and it still doesn't work. I can't figure out why. It doesn't give me any error or anything, it's like it doesn't register that the file is there at all. I've currently got the scroll.js file in the skin1 directory. Yet if I paste the code directly into the home.tpl file it works perfectly?? Is there any other information I could provide you with? Thanks Chris
__________________
X-Cart version 4.0.17 |
|||||||
#4
|
|||||||
|
|||||||
![]() Do you have {literal} tags around the code in the external file? Is the external file set to at least 644 permission?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||
|
|||||||
![]() I don't have the {literal} tags in the external file because I used them in the home.tpl file instead;
Quote:
Yes for the 644 permission.
__________________
X-Cart version 4.0.17 |
|||||||
#6
|
|||||||
|
|||||||
![]() Just for kicks, try putting the literal tags in the file itself and don't use them on home.tpl.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#7
|
|||||||
|
|||||||
![]() I just did then, but still no luck
![]()
__________________
X-Cart version 4.0.17 |
|||||||
#8
|
|||||||
|
|||||||
![]() Hmmm..I'm at a loss..I use a couple of external calls on most of my sites and as long as the path is correct it works.....
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#9
|
|||||||
|
|||||||
![]() Yeah I can't figure it out at all. My site is www.truegamer.com.au and I'm trying to insert it below my Geotrust logo. At the moment all that appears is the table border. If you type the URL where the scroll.js file is located; http://www.truegamer.com.au/skin1/scroll.js it appers fine.
I figure it must be something to do with the actual external code. Maybe I forgot to take out a <script> tag or something. I don't know enough about javascript so if anyone can take a look at it, (qouted in my fist post), I would be very thankful.
__________________
X-Cart version 4.0.17 |
|||||||
#10
|
|||||||
|
|||||||
![]() I'm getting a JavaScript error when I load your site, so that may be the issue:
Line: 145 Char: 10 Error: Expected '/'
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
|||
X-Cart forums © 2001-2020
|