1. Technology
Send to a Friend via Email

Controls and Widgets

Add Javascript controls and widgets such as slideshows and hypertext popups to enhance your visitor's interaction with your page.
  1. Arrays (14)
  2. Cookies (5)
  3. Dates (24)
  4. Effects (4)
  5. Events (8)
  6. Form Controls (20)
  7. Functions (13)
  8. Multimedia (3)
  9. Objects (6)
  10. Site Navigation (26)

Separating JScript and JavaScript
JavaScript and JScript are two different languages but similar enough for you to use feature sensing to run the same code as either. An alternative is to set up separate scripts to run one or the other depending on which the browser supports.

Letters to Numbers
There are lots of things you could do with letters if you could somehow convert them into numbers first. This simple function can do that for you.

Converting Arrays
This function uses two arrays to generate a third. One array contains all of the elements you want to be able to feed into your output array while the second array of numbers identifies which of those elements to place in each position in the output. This has many different possible uses and the example sets up a transposition cypher.

Ideas Machine With Links
A variant on my ideas machine script. This one displays a random idea that actually links to another page. Your visitors can either follow the link or request another idea.

Breaking Text into Chunks
You might not need to break text up into equal sized junks very often but when you do adding this method to your strings will make doing so much easier.

Buy Now Hover Button
If you have a sales page that is too long to fit the browser then your visitors may not be able to see the link to make their purchase at the time they decide to buy. You can solve that by adding a hovering "Buy Now" button to your page which will be right there for your visitor to click on to make their purchase regardless of where on the page they have got to at that time.

Obtaining Your Visitor's IP Address
JavaScript can't actually access your visitor's IP address directly but with a little help from some other language you can make the IP address available for processing in JavaScript.

Ideas Machine
Ad an "idea" to your web page to help get your visitors started on performing an action. If they don't like the first idea you present them with then they can simply press a button on the page to be presented with another idea which they will hopefully like better.

Modal Dialog Boxes
Javascript provides three dialog boxes - prompt, confirm, and alert - which will not necessarily meet all of your needs. To get around this limitation you can always add your own custom "dialog boxes" into the web page itself.

Display Author Time
The author of a web page need not be in the same time zone as the server on which the site is hosted. This script allows the author to display the time at their location on the page regardless of where the site is hosted or where their visitors are provided that the visitors have their computer's time set correctly for their location.

Highlighting Selected Words
You might have seen the effect where the words that you select are highlighted in a web page. Here's how you can add a small piece of Javascript to your page to easily allow people to select what to highlight on your page.

Display Random Image or Quote
If you have several quotes, images, or ads to choose from and you want to have one of them randomly selected to display on your page then this script provides the basic template you need to use to set it up.

Calculator Tutorial
A series of tutorials explaining one way to use Javascript to create a calculator.

Countdown Timer
Place a timer on your web page that counts down to a specific time at your location.

Add to Favorites
Only Internet Explorer provides the option of having a link that will add to the favorites menu. This script will replace that with a message advising which key combination to use to bookmark the page in other browsers.

Encrypt Your Web Page
Some people pay hundreds of dollars from a program to encrypt their web pages. You can achieve the same result free by using this script. Either way those who know how will have your page decrypted in about 30 seconds.

No Right Click Script
If you really want to annoy your legitimate visitors by blocking access to the context menu then this script provides the simplest and most effective way to do it.

Is Java Enabled?
You can use Javascript to test whether your visitor's browser has a Java plug-in installed and enabled.

Password Protection
How to use Javascript to password protect a page.

Disabling the Netscape 7 Menu Bar
No matter what web page encryption you use to try to protect your page content anyone with Netscape 7.0 can easily obtain a decrypted copy of your page just by selecting 'save as' from the file menu. This Javascript removes their menu bar temporarily to stop them doing this.

©2014 About.com. All rights reserved.