|
|
Adding JavaScript code
JavaScript is a language that runs as a small program in a browser.
JavaScript is used to add animation or other features to your site.
Examples of what JavaScript can do are:
- Add to your webpages a date or time that is
always current.
- Create a password-protected page.
- Animate pictures on your page.
- Detect the browser that a visitor is using
and tell them.
- Welcome back a visitor if they have been there
before.
- Break your site out of a frame (such as the
Hotmail frame) if your site opens inside one.
- Change the color of the scroll bars down the
right side of your page.
There are several sources of free pre-written JavaScript
scripts or code on the Internet. These include:
In order to use these scripts, you usually have to copy the code
and paste it into your webpage. Instructions are usually included
at the site where you get the JavaScript. For example, here is how
you can use the JavaScript codes that are found at www.javascriptsource.com:
1. Go to www.javascriptsource.com
2. Click on a link at the top, such as calendar, games, bg effects
etc.
3. Read what each of them does. Sometimes you can test out the script
on this page as well.
4. If it looks interesting and you want to add it to your site, click
on Get Source Code.
5. Follow the directions in the box. There will be from one to three
steps. Copy and past the code directly into the HTML view of Dreamweaver.
6. Save (<Ctrl> + S) and preview (F12)
your script in a browser (or follow their instructions if they are
different from this).
More script sources:
|