javascript

Update Select Elements On The Fly

In the previous post,’Create Dynamic Date Selects‘, we ended up with select lists for the Month, Day and Year. In this post, we’ll make these more intuitive by only displaying the correct number of days for a given month/year combination;

Select All Text InTextarea Or Input

Perhaps you have a textarea pre-filled with instructions, for example, ‘Use this area to write a simple bio about yourself…’. When the user wants to fill in the textarea, he has to delete your instructions first, pretty tedious to say the least.

Create Your First AJAX Request (Part Three)

The complete script can be downloaded here
In the last part of this series, we’ll create ’showdetails.js’. This will turn our web page into a AJAX-powered web page!
In the first part we created the XMLHttpRequest Object. Now we need to create an instance of it.

Create Your First AJAX Request (Part Two)

An example of what you’re creating can be seen here.
The complete script can be downloaded here
In the first part, we created a function, getRequestObj(), that we can now use to initiate a new XMLHttpRequest object.

Create Your First AJAX Request (Part One)

AJAX is now everywhere on the web. The ability to update content on the web page without reloading the page provides a slicker experience to the user whilst also reducing the load on the server (the server only needs to output the updated content and not the entire page).

Alternate Background Colours

To make it easier for your visitors to visually separate similar elements in your web page (such as table rows, paragraphs, list items etc), you can give alternate elements a different background colour. You can achieve this using a server-side script but here’s a really simple way to do this using JavaScript.