Handling Scripts

  • Description : Although this part of the tutorial will not teach you scripting languages such as javascript it will inform you how to include a script in your page.
  • Language : HTML
  • Date Added : 7th October, 2009
Bookmark and Share

Including a script in your web pages is as simple as including a .css file in your page. Below is the code for including an external JavaScript file:

Code :
<script type="text/javascript" src="yourJSFile.js" /></script>

You can also write internal JavaScript, although if you want to use the same JavaScript on multiple pages you should use an external file. Here is an internal javascript entry:

Code :
<script type="text/javascript"> document.write("This is some text written with JavaScript!") </script>
Output:
This is some text written with JavaScript!

The above script will simply write some text onto a web page, pretty useless as it's easier to do with HTML, but JavaScript is a powerful tool. Hopefully tutorials for JavaScript will be available in the near future. Finally always remember to account for older browsers, below is how to do this:

Code :
<noscript>Your browser does not support JavaScript</noscript>

This concludes a short tutorial on scripting, a more thorough tutorial on JavaScript will hopefully be available in the near future!



Login Required

To post comments you must sign in to your account below!

User :
Pass :

If you do not currently have an account click here to create one now!