An open API service indexing awesome lists of open source software.

https://github.com/nikku/jquery-controls

Registration of ajax handlers to bind to certain elements of a page
https://github.com/nikku/jquery-controls

Last synced: over 1 year ago
JSON representation

Registration of ajax handlers to bind to certain elements of a page

Awesome Lists containing this project

README

          

jQuery controls
===============

Small [jQuery](http://jquery.com/) plugin which allows other jQuery plugins to
register custom click controls on page elements.

Features
--------

* Offers `$.fn.controls.bindings` as an entry point for other jQuery plugins to add custom click controls

Requirements
------------

* [jQuery](http://jquery.com/) (tested with jQuery >= 1.4.2 but might work with earlier versions)

Usage
-----

Include requirements and plugin in the header of your website

```html






```

Register controls for a certain element, e.g. a link with `.ajax` as class

```html

$.extend($.fn.controls.bindings, {
"a.ajax": function(event) {
alert("Won't trigger original click: Is an AJAX link!");
event.preventDefault();
}
});

```

Execute `.controls()` on an element to bind all matching triggers to it

```html

// Wait for page load
$(function() {
// Bind to document
$(document).controls();
});

```