1. Home
  2. Computing & Technology
  3. JavaScript

Guide's Function Library

A collection of functions that you can use as a basis for building your own scripts so that you don't have to start from scratch.

Dynamic Forms

This Form object makes dynamically generating forms using JavaScript fairly simple. Each form field is created by calling the appropriate method and passing a few parameters. Labels are also created and linked to the associated form field.

Query Strings

Query Strings allow you to pass information between pages on the end of the URL. This function will extract the information passed and load it into an array.

Posting Values using JavaScript

While a regular link has to pass any variables to the next page via the querystring, the addition of some simple JavaScript will allow us to post the values instead.

Current Page References

A javascript function that extracts the page address details into a set of easily referenced fields.

Browser Window Size and Position

A collection of javascript functions that return information about the size and position of the browser window.

Cross Browser DOM Script

There are three different Document Object Models used by the various different web browsers. This code will determine which of the three that a given browser supports and provides a function that you can call to allow your code to work with all three DOMs.

Object Functions

A collection of javascript functions that return information about objects on the web page. If you need to know where an object is, how big it is or whether it is visible then these functions will tell you.

more object functions

A collection of javascript functions that will move objects about objects on the web page.

Convert to Roman Numerals

You can easily convert any number between 1 and 3999 into roman numerals using this simple function.

Making Change

This simple script allows you to calculate what coins and notes to use to give someone their change. With the example form you simply enter the amount of change required and it will present a list of how to provide it. Can easily be added into any calculator that needs to process money that involves giving change.

Limiting Selections

Grouping checkboxes and limiting the number of entries selected in each group using Javascript.

Maths Array

The mathArray class allows you to perform lots of numerical calculations on all of the entries in an array. It should make writing code that involves several numeric arrays and lots of interaction between them much easier.

Split Text Line

This function will assist you when you want to break up a piece of text into multiple lines so that it fits within a specified line length. The function inserts extra line breaks between words so as to give the maximum length line that is not longer than your specified maximum and without splitting any words (unless the words are more than one line long).

First Time Only

Perform an action only the first time someone visits your page. This Jacascript sets a cookie to stop the action being performed if they come back to the page during their current browser session.

Browser Detection

Many people using browsers other than Internet Explorer set their browser to report itself as IE because of all of the scripts that people use that don't recognise the other browsers as existing let alone being able to run everything IE can and more. This script works out what browser your visitor is really using regardless of what they have set it to report as.
Explore JavaScript
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript
  4. Script Library
  5. Function Library

©2009 About.com, a part of The New York Times Company.

All rights reserved.