useful programming resources
W3 Schools programming resources
Learning Ruby, an interactive Guide
An HTML validation tool, Very Important
Lists and CSS styles elegantly explained
Step by step lessons in PHP programming
Useful tools
Text Wrangler - General Purpose text editor
Transmit Text Edit and FTP client
The Total Validator validation tool
Now time for a new buzz word: Document Object Model.
This brings up another buzz word: Object Oriented Programming
Javascript and the latest version of PHP are Object oriented programming scripts This is a way of looking at programming projects that tries as much as possible to emulate the real world environment. An object is a noun. Things like cats, bats, birds, bees, fences, bookshelves are all objects. Objects have methods. This is things that objects do. A method for the cat object is catch mouse If you remember the discussion on CSS, you remember the concept of inheritance: Once something is defined at a high level, it is defined for all things that come from this level.
This brings up the concept of Classes. Classes can have subclasses. The class Feliede includes cougars, lions, tigers, leopards, bobcats, and the little kitten under your desk stalking the power cord. An object is part of a class. Agatha, the cat sleeping on the windowsill next to me, is an object of the class cat, which is a subclass of feliede. Right now her method is nap. That is usually her method most of the time except at four AM when her method is often stalk and kill my toes. Most cats have identical methods as Agatha. Using classes, we can create new objects of the same class. Each object can have different instance variables, that is, things that are unique to that object in the class, such as the pattern of colors to Agatha's fur, her age, her location (which has changed to the roof of the storage shed) and current method (watching the birds in the garden). In the garden, there is another instance of the cat class named Buster. Buster has different instance variables of fur pattern, age, location (He is hiding in the raspberry bushes) but he is doing the same watch birds method.
How this applies to web pages and the Document Object Model is that each HTML tag is an object, each object can have its own name, or id. When you set up a table with an ID, that ID makes a unique instance of the table class. Like all members of the table class, it has the same methods, but you can now work with the instance methods individually.
Javascript works on the client side, and using Javascript you can use the Object Model to dynamicly change elements within the browser as the user interacts with the code.
In this instance, all we got were alerts, but Javascript also does form validation on the client side. This way as you fill out a form, javascript watches and makes sure you put in correct values, fill in required values, and don't put in illegal values as you fill out the form. The point of client side validation is to make the user experience easier by making sure the form isn't filled all the way out, only to be rejected by the server and sent back blank for the user. Many users (like me) if they have to fill out a complicated form more than twice because of server side validation rejects just drop the process.
That does not mean validation does not need to happen on the server side. It does. There are malicious folks out there looking for a way to break into web pages It is not a good idea to make their job easy. A web page can survive without javascript validation, but it is a good idea. Anything to make the users job easier. But validation on the server side is vital.