Archive

Archive for the ‘JQuery’ Category

JQuery Plugin Mechanism

May 11, 2011 Leave a comment

Extending the Library

Another excellent article on extending JQuery.

The jQuery library is centered on a root object, which exposes a number of methods. After doing whatever tasks it was called to do, each method just returns the instance of its parent object. In this way, a new call to another method can be arranged on the same expression.

(function( $ ){
 $.fn.yourPluginName = function() {
 // your code here
 };
})(jQuery)

Read the rest of the article http://drdobbs.com/web-development/229403172

Categories: Code, JQuery

Using the JQuery Cache

April 23, 2011 Leave a comment

Using Client Side Storage

Session duration storage management made not a total pain in the browser.

The jQuery library offers ..  a simple but quite effective API to store data in the browser’s memory for the duration of a session.

Read more http://drdobbs.com/web-development/229402114

Categories: HTML, JQuery

JQuery Event Handling

December 18, 2010 Leave a comment

De-complicating Browser Event Handling

JQuery simplifies event handling across browsers.

In jQuery, you define an event handler by simply passing the code you want to execute to a function that identifies the particular event.  There are several ready-made functions for most common events such as click, blur, hover, change, dblclick, focus, select (text selection), ready, scroll, and resize , plus multiple events for keyboard and mouse actions.

Read the article at Dr. Dobbs http://www.drdobbs.com/java/228800832

Categories: Code, JQuery

Dr. Dobbs on JQuery Chaining

November 29, 2010 Leave a comment

Interesting article on the basics of JQuery function chaining.  An interesting read.

Methods and method chaining

The primary characteristic of the jQuery library is its use of CSS selectors to “query” for pieces of the current document object model (DOM). Each query retrieves a collection of DOM references often referred to as a “wrapped set.” What to do next? You just call a method on the elements in the collection, and if the result is another jQuery collection, then you can call another method — thus building a chain of calls. But let’s have a look at some of the most important and commonly used methods.

More at http://www.drdobbs.com/java/228300461

Categories: JQuery

jLambda : Don’t call us, we’ll call us

November 1, 2009 Leave a comment

Very cool article on lisp-ing JQuery — I’m really loving this.

jLambda: A jQuery plugin for succinct anonymous functions | from.bz.

… from the article

Generally, the plugin adds the global function $l (lowercase L, for “lambda”), which “wraps up” a jQuery expression into a function that can be executed later. For example, instead of writing:

1.function() {
2.$(this).hide().addClass('foo').css('color', '#fff')..;
3.}

The plugin allows you to write:

1.$l.hide().addClass('foo').css('color', '#fff')..;

This allows succinct expression of callback functions.

1.// Without plugin:
2.$('.foo').click(
3.function() {
4.$(this).hide();
5.});
6.
7.// With plugin:
8.$('.foo').click($l.hide());
Categories: Code, JQuery