Scripts to enhance and add
functionality to your site
Below you will find some commonly used
JavaScript.
Please note that all these scripts are free for use but
you must not delete any headers that claim copyright or ownership of
that script.
If you are after a particular script there are literally thousands
of sites that offer free cut 'n' paste JavaScript. Just do a quick
search on Google for "free javascript" and then take
your pick! :-)
Pop Up Window
This script
allows you to install a pop-up window which is launched when a visitor
clicks a link. See below for an example.
Of course you will need to put some of your own information into the
script to allow it to work for you. First you will need to know the name
of the page you want to display in the window and them replace 'mypage.htm'
with the name of yours.
Next you may want to change the size of the window. This is done by
altering the width and height values in the script.
You will also want to change the wording of the text link. This is done
by changing Open Window to whatever you want it to say.
Alert Box This small alert
box pops up when a visitor enters your page. You can use this to draw
their attention to site updates, changes, special event and offers,
anything you can think of really. All you need to do is alter the script
to incorporate your message. See below for an example.
Close Window
Text Link A very simple
script that allows you to provide a "close window" text link.
Particularly useful on pop up windows. See below for an example.
Cross
Browser No Right Click Script This script
enables you to protect images and text on your site. While it is by no
means a total solution to protecting your site content it does act as
somewhat of a deterrent. Having said that this script is particularly
effective if used in conjunction with a frames site. See below for an
example.
Back
Buttons
Another favourite I'm asked for is a "BACK" button that
emulates the back button on the browser. This is a relatively simple
script and can be altered to use an image, text, or a standard HTML
button. See the scripts below for some examples.
To emulate your browsers "Forward'' button you can use the same
scripts as above by simply replacing the history.back with history.forward
If you want a standard HTML button use this script:
Display messages in browser status bar on
link hover:
<a href="index.htm" OnMouseOver="self.status='Go to my
homepage!';
return true" onmouseout="self.status=''; return
true">Visit this page.</a>
Sample: Visit this page. Adding a Title attribute to your links creates a mini-popup
description:
<A HREF="http://www.sacollectables.com" TITLE="Collectables,
Biographies, Resources & More">Salvation Army Collectables</a>
Sample:
Salvation Army Collectables