Posted by tcmug on August 30, 2011 at 9:44am
This is an extremely simple module that allows a front-end developer to reload regions with ease using a single javascript command that takes url, post data and regions as the only parameters.
As an example, the below code ajaxifies all the links.
(function ($) {
Drupal.behaviors.ajaxRegionsExample = {
attach: function(context, settings) {
$("a", context).click(function() {
// Simply reload ALL of the regions when ever a link is clicked.
href = $(this).attr("href");
var regions = new Array();
for (i in Drupal.settings.ajaxRegionsExample.regions) {
region = Drupal.settings.ajaxRegionsExample.regions[i];
regions[i] = {
selector: '.region-' + region.replace("_", "-"),
region: region
};
}
Drupal.ajaxRegions.load(href, {}, regions);
// Don't do da default thang.
return false;
});
}
}
} (jQuery));Please see the very simple example module for details.
Downloads
Other releases
Development releases
Project Information
- Maintenance status: Actively maintained
- Development status: Under active development
- Reported installs: 45 sites currently report using this module. View usage statistics.
- Downloads: 545
- Last modified: February 14, 2012