Forum Moderators: open

Message Too Old, No Replies

How to Externalize my Jscripts

I searched and searched I aplogize

         

fatmarley

5:32 am on Apr 20, 2005 (gmt 0)

10+ Year Member



I am a complete nob when it comes to Jscript, I have never looked at the code and never written any code so it just confuses me to no end.

Anyways on my site I have numerous links and in order to reduce the size I grouped them all by country or theme and by using a javascript it toggles the links, sort of like a drop down menu.

I would like to externalize the script since it is a lot of code, but how do I do this? Please treat me like an idiot and use simple language.

thanks everyone.

If you are confused, like me, then look at my site and on the left side you will see a link section, if you click on the map of korea you will see what I am referring to.

www.gumbi.ca

(on a side note, is this possible using css and does anyone know of any websites that explain how to create this same feature with css.)

rocknbil

3:25 pm on Apr 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<head>
<link rel="stylesheet" type="text/css" href="path_to/your.css">
<script language="Javascript" src="path_to/your_javascript.js"> // imported script </script>
</head>

Be sure to name your extenal files with a .css and .js extension. Also note the little comment between the opening and closing script tags. I've experienced some problems without something in there, like if you do

<script language="Javascript" src="path_to/your_javascript.js"></script>

Last thing, probably not worth mention as most servers have this, but if the text/javascript and text/css MIME types are not included in the server configuration it won't work. This is rare these days though.

Bernard Marx

6:18 pm on Apr 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Surely you meant "newb"?