// set up a delegated event for all buttons with class mapButton
jQuery('body').on('click', '.mapButton', function(e) {
e.preventDefault();
// get the rowid from the data attribute we added to the button markup
var rowid = jQuery(e.target).data('rowid');
// fire off an AJAX call the Fabrik userAjax class
var url = Fabrik.liveSite + "/index.php?option=com_fabrik&format=raw&task=plugin.userAjax&method=doButton";
jQuery.ajax({
url : url,
data : {
rowid: rowid
}
}).done(function (r) {
// show the result in an alert
alert(r);
});
});