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 :
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 :
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 :
This concludes a short tutorial on scripting, a more thorough tutorial on JavaScript will hopefully be available in the near future!
To post comments you must sign in to your account below!
If you do not currently have an account click here to create one now!