jQuery: serialize elements outside forms

A good question today from Stack Overflow: how can we serialize an element which is not a form? jQuery provides the serialize() and serializeArray() methods that operate on forms by turning attributes and values into properties and values of a returned JSON object (the latter) or by building a standard query string (the former). However, creating a JSON object from an element is quite simple. Let's see why.

jQuery: password strength checker

We can use JavaScript regular expressions together with jQuery to create a simple plugin that checks the strength of a user-defined password. The concept behind is quite simple: every time a user types a character in the input field, the value inserted is compared against the corresponding regular expression. Passwords can be medium, weak or strong in terms of strength. Strength doesn't depend on the number of characters inserted, but on the combination of letters, digits and special characters. Let's see the details.

jQuery: smart Lavalamp menu plugin

Yesterday a friend of mine was in trouble because he desperately needed to create a jQuery Lavalamp menu for a client featuring some peculiar characteristics, such as the ability to start from the current page item and an intelligent movement sensor which allows the cursor to stay on the last selected item. I created for him a simple jQuery plugin that performs all these tasks. Let's see the details.

Integrating jQuery plugins in WordPress

One of the most frequently asked questions on forums, blogs and mailing lists concerns the integration of jQuery plugins with WordPress. Integrating jQuery plugins with WordPress is not a matter of queuing scripts only, but it also means understanding the correct hierarchy and order by which scripts are executed within WordPress. Let's see the details of this topic.

jQuery: Observer Pattern on slideshows

I've just finished to work on an interesting jQuery/WordPress project (you can find it here) where I had to build an interactive slideshow very similar to a classic jQuery slot machine in its inner functioning. The only problem was to keep track of the visibility of the slides, that is, being sure that the current slide was visible. This is a fantastic use case for the Observer Pattern.

jQuery: serialize a form as a JSON object

If you're using AJAX with a form and you want to pass a JSON object to one of the jQuery's AJAX methods used to process the request, you will probably wonder how this could be done. Basically, you should convert your form values to a plain array, loop through all the items in the array and finally return a plain object literal. Let's see the details.

jQuery: Mati, professional image gallery

Mati is a professional jQuery image gallery that I've created as an homage to my little niece Matilde. It's a grid-based image gallery that allows you to navigate through the image sets and view the full-size image preview. It's free. The only thing you should do is to add an image preloading routine to improve performance. I hope you find it useful.

jQuery: how to split images on slideshows

Splitting and dividing images on a jQuery slideshow is not so difficult as it could seem at a first glance. In fact, if you know the technique that works behind the scenes, you'll probably end up with realizing how this feature is simple in its implementation. In a nutshell: it's only a matter of layers and background images. Let's see the details.

jQuery: a usability lesson

Why jQuery is one of the most used JavaScript libraries available on the web? Perhaps it has more features than other libraries or more flexibility. Perhaps its design is better conceived. Nothing like that: jQuery is a successful project simply because it has usability in mind. Usability is a too often neglected aspect of library development. jQuery fills this gap by providing a simple way to perform tasks that other libraries tend to make too complicated for the average user. That's the jQuery's secret.

jQuery: using timers with animations

JavaScript timers constitute the inner engine of any good automated jQuery slideshow. Although timers can be really handy in most situations and case-scenarios, their rules are somewhat obscure to many developers. The point is that timers can be used in a wide range of use cases, not only in animations. For that reason, you should understand how timers work when applied to jQuery animations before developing any practical implementation that makes use of them.