AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Web Development - Javascript - Getting Started - External Scripts

External Scripts



For this guide we won't be using external javascripts but it's worth pointing out the benefits at this stage.

As you progress through this guide you will learn about using functions. Once you reach this point you will start to see the advantage in using external javascript files.

External javascript files will usually contain frequently used javascript snippets/functions etc and are linked to from your webpage. External javascript files normally have a .js file extension, for example myscripts.js

You link to your external javascript file with the following code

<script language="JavaScript" src="/path/to/filename.js" type="text/javascript"> 
<!-- 
// -->
 
</script>

Normally this is placed between the <head></head> tags.

Your external javascript file should not include any <script></script> tags. Adding the tags will generate errors.

You can link to more than 1 javascript file by repeating the above code and changing the path and filename accordingly.

Next we'll take a look at writing our first script




16 Nov 2003




Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]