Check if Email Username Exists with CodeIgniter and jQuery Validation Plugin

A common feature of most new user registration forms is a message telling you whether your chosen username or e-mail is already taken. The check is done through an AJAX request. Using the jQuery Validation plugin, the remote option can be used to request a URL that returns JSON data. Using CodeIgniter, this URL is a new function in the controller used for registration. In this example, the register_email_exists() function returns true or false, after checking the entered form value against the database. See the following example code for the basic PHP and JavaScript you'll need to make this work.

jQuery One-Liners and Reuseable Code Snippets for Common Tasks

For the last few weeks I've been collecting tiny morsels of jQuery and straight JavaScript that I've needed for building sites. I had found myself needing the same small scripts over and over. Rather than rewriting and checking an API/plugin reference, now I can just copy from this list. Most of these snippets are a few lines each. Some are simple. Some aren't.

Expandable Maximum List Items jQuery Plugin: Hide after X number of bullet points

This jQuery script will automatically hide all excess list items past a maximum number. It then dynamically adds an expand/collapse link that uses the slideToggle effect. Each list item is collapsed in succession to give the appearance of using slideToggle on a container. The max number, speed of animation, and expand/collapse HTML can be passed as options.