Uses for JavaScript
Dateline: 07/19/99
Today I'm going to highlight a few of JavaScript's best uses.
Form Validation
Sometimes you'll want your users to enter a specific type of data (say, a
phone number or e-mail address) into a form field. It's important that the
user's input conforms to a certain format. You can (and should) have your
web server verify that this information is of the proper format before using it,
but constantly depending on your web server can lead to lots of unnecessary work
for your server as well as slow down your user's experience.
As an alternative, you can include JavaScript in your web pages to validate
your forms on the user's machine before the data is submitted to the
server. (Note: Since not all browsers support JavaScript, it is a good
idea to have your server verify the data as well. Using JavaScript will
still substantially reduce the load on your server.) For information about
Form Validation, see Form Verification:
The Right and Wrong Way and Form
Validation: 4.0 Stuff.
Make Your Site Look Fresh
A web site that looks up-to-date (whether or not it really is up-to-date) looks
better than a web site that doesn't. JavaScript can help you keep your web
site looking up-to-date when you can't pay it constant attention.
See Today in JavaScript to learn a
bit about how to do this, or visit Scripts -
Time for some cut-n-paste scripts.
Make Your Site Look Cool
It's easy to get carried away with this one, so don't overdo it. However,
some popular "gizmos" that JavaScript does best are:
Text Scrollers
These gizmos scroll text inside of a form's textbox control. For examples
and tutorials, see Scrollies and More
Interesting Scrollers.
Text Effects
These are ways to make text appear more interesting to attract attention.
Examples are Wavy Text, which makes
text appear goofy by varying the font size, and The
Color Fade, which fades text from one color to another.
Browser Compatibility
JavaScript has its share of incompatibilities. Fortunately, it's also
great at figuring out what its incompatibilities are. Check out Detect
Every Browser and Netscape This, IE
That... for more information here.
Visit the message boards!
Previous Features
 |