2 * jQuery UI AJAX Links Maker 1.0.0 beta
4 * Transforms normal anchors into AJAX anchors. The AJAX URL is took from
5 * href HTML attribute. Anchors to be transformed are found within elements
6 * listed in option linkSelectors. The AJAX content retrieved from the server
7 * is placed in the option target.
9 * Copyright 2011, Călin-Andrei Burloiu
10 * Dual licensed under the MIT or GPL Version 2 licenses.
11 * http://jquery.org/license
17 (function( $, undefined ) {
19 $.widget( "ui.ajaxLinksMaker", {
20 version: "1.0.0 beta",
28 for (i in widget.options.linkSelectors)
30 var selector = widget.options.linkSelectors[i];
32 $(selector + ' a', widget[0])
33 .each(function(index) {
34 var url = $(this).attr('href');
36 if (typeof(url) == 'undefined')
40 .click(function(event) {
41 event.preventDefault();
46 $(widget.options.target).html(data);