![]() |
Calling external JS
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 |
Put the .js file in your skin1 directory and call it like this:
<script language="JavaScript1.2" src="{$SkinDir}/scroll.js"></script> |
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 |
Do you have {literal} tags around the code in the external file? Is the external file set to at least 644 permission?
|
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. |
Just for kicks, try putting the literal tags in the file itself and don't use them on home.tpl.
|
I just did then, but still no luck :(
|
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.....
|
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. |
I'm getting a JavaScript error when I load your site, so that may be the issue:
Line: 145 Char: 10 Error: Expected '/' |
All times are GMT -8. The time now is 07:11 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.