Tutorials - Page 2
Are you new to JavaScript, or trying to learn advanced techniques? These tutorials will show you step by step how to create and add JavaScript code to any Web page. There are also many advanced tutorials to enhance your understanding of the language. For Ajax instructions, see our Ajax tutorial section.
-
Using Multiple JavaScript Onload Functions
When using multiple scripts, often they are executed using onload event handlers. This can sometimes be a bit tricky if more than more is used. Check out this easy, fool-proof method for use with your scripts.
-
A Practical Guide to Numbers in JavaScript
Dealing with numbers, strings and JavaScript can be frustrating for a beginner. This is a down-and-dirty explanation of converting strings to numbers, detecting if a string is a number, and handy functions for manipulating numbers.
-
Are You Ready for This?
This tutorial takes you through a page's ready states and shows how to write JavaScript code to determine when a page's DOM elements are loaded and available.
-
Calling an ActionScript Function from JavaScript
This tutorial will show you how to use the FlashProxy JavaScript class to proxy function calls between Flash and JavaScript.
-
Cookie Monsters Inc
One of the most powerful tools available to the Web developer are HTTP cookies. Here's the 411 on how cookies work, complete with public domain JavaScript functions.
-
Developing a Simple Validation Library in JavaScript
This tutorial teaches some of the most commonly used JavaScript functions for client side validation of HTML forms. You can reuse these scripts to inject into server side controls.
-
Introduction to the Document Object Model
The Document Object Model, or DOM, is the interface that allows you to programmatically access and manipulate the contents of a Web page. This tutorial is a discussion on the DOM representation of a document and the methods it provides to access those objects.
-
Using Prototype to Load Javascript Files
This tutorial shows the implementation of the general technique of loading functionality via scripts based on the availability of DOM elements.
-
A Personalized "Thank You" Pages
This tutorial will show how to create a personalized "thank you" page for all of your forms. The method described here is accomplished with JavaScript and cookies.
-
Browser Detecting (and What to Do Instead)
Browser detection has proven unreliable. An alternative strategy is known as object or feature detection. This tutorial examines why browser detection does not work, and looks at how to implement feature detection.
-
Effectively Requiring Cookies With All Browsers
If you have any Web pages that must not be viewed unless a certain cookie is set, this article contains the means to make it so. The article sidesteps the argument that restricted content can be viewed simply by turning off JavaScript. It will show you how to redirect browsers to a different page if they don't have JavaScript turned on.
-
JavaScript, DOM, and the Humble Form
So you've got a form on your Web page, and now you want JavaScript to interact with it. This tutorial outlines the various methods used when scripting forms, and explains the Form Document Object Model in detail. Includes code examples of the two main methods with an emphasis on Web standards and best practices.
-
Loading Two or More Frames Simultaneously
When you have a framed site and want to load content into two or more frames when only one link is clicked, JavaScript can be used to accomplish it.
-
Understanding the JavaScript RegExp Object
Need to match and replace patterns on a Web page? JavaScript can do the job quite well. This tutorial will teach you how, with an introduction to the JavaScript RegExp object and its methods.
-
Attributes > Classes: Custom DOM Attributes for Fun and Profit
XHTML gives the ability to extend markup with customized, semantically meaningful attributes. The battle between classes and attributes might be a holy war to some and unknown to most others. To clear things up, this article gives several examples and provides functions for working with your own custom attributes.
-
String Concatenation and String Operators
Concatenation is the process of combining two or more separate strings together to form one string. You can also use string operators to break up a long string into multiple strings to make your source code more readable. This tutorial explains how to use both procedures.
-
The JavaScript Array: Definition and Syntax
A JavaScript array is a beautiful thing. It is a little database holding any given type of information, and is easily accessible to you and your scripts. To understand each part of an array, this tutorial examines custom arrays and DOM arrays.
-
The Perfect Pop-Up
If you believe the likes of Jakob Neilsen and his supporters, nothing is more evil than pop-up windows. And in many ways, this is correct. Why? Well, we'll list the reasons soon enough, but in a nutshell it's because they are nearly always poorly implemented or simply not needed. This tutorial will show that, with the right thought, pop-up windows can be used without upsetting anyone - particularly the person browsing your site.
-
A Personalized "Thank You" Page With Any Form
This tutorial will show how to create a personalized "thank you" page for all of your forms. The method described here is accomplished with JavaScript and cookies.
-
Using JavaScript To Call PHP Database Routines Between Windows
This tutorial shows how to create a select or dropdown list for use with database routines. Learn how to gather input in one window for processing in another window. (01/25/2007)
-
JavaScript Cheat Sheet
The JavaScript cheat sheet is designed to act as a reminder and reference sheet, listing methods and functions of JavaScript. It includes reference material for regular expressions in JavaScript, as well as a short guide to the XMLHttpRequest object.
-
Creating an Autosuggest Textbox with JavaScript: Part 2
In the first part of this series, you learned how to create type ahead functionality in a textbox, which presents the user with a single suggestion for what they've already typed. This article builds upon that functionality by adding a dropdown list of multiple suggestions.
-
Creating an Autosuggest Textbox with JavaScript: Part 3
In the second part of this series, you learned how to add a dropdown suggestion list to the autosuggest control. This week you'll learn how to complete the modifications, make your suggestions case insensitive and get the suggestions back from the server instead of using client-side information.
-
The JavaScript Diaries
JavaScript is a versatile language which can enhance your Web site. This is an ongoing series on the process of learning JavaScript, starting from the very beginning.
-
Basic Date Display Script
Would you like to display the current date on your Web pages? One option is to use JavaScript. This tutorial shows you how to implement an existing script. The script itself also comes with comments so you can understand how the whole process works.

