Sha256: 059d077cf4e340fdb69be361902449936fa30cbf3dc2f717f7bd32fd5994b488

Contents?: true

Size: 619 Bytes

Versions: 96

Compression:

Stored size: 619 Bytes

Contents

// Set a form to send via ajax and remove current errors
// usage:
//   ajaxifyForms('#new_subscriber')
function ajaxifyForms(selector) {
  $(selector).live('submit', function() {
    $(this).find('#errorExplanation, .success').slideUp('fast', function() { $(this).remove();});
    $.post($(this).attr('action'), $(this).serialize(), null, 'script' );
    return false;
  });
}

// Set a link to get via ajax
// usage:
//   ajaxifyLinks('#tags a')
function ajaxifyLinks(selector) {
  $(selector).live('click', function() {
    $.get($(this).attr('href'), $(this).serialize(), null, 'script' );
    return false;
  });
}

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
noodall-ui-0.0.17 public/javascripts/ajaxify.js
noodall-ui-0.0.16 public/javascripts/ajaxify.js
noodall-ui-0.0.15 public/javascripts/ajaxify.js
noodall-ui-0.0.14 public/javascripts/ajaxify.js
noodall-ui-0.0.13 public/javascripts/ajaxify.js
noodall-ui-0.0.12 public/javascripts/ajaxify.js
noodall-ui-0.0.11 public/javascripts/ajaxify.js
noodall-ui-0.0.10 public/javascripts/ajaxify.js
noodall-ui-0.0.9 public/javascripts/ajaxify.js
noodall-ui-0.0.8 public/javascripts/ajaxify.js
noodall-ui-0.0.7 public/javascripts/ajaxify.js
noodall-ui-0.0.6 public/javascripts/ajaxify.js
noodall-ui-0.0.5 public/javascripts/ajaxify.js
noodall-ui-0.0.4 public/javascripts/ajaxify.js
noodall-ui-0.0.3 public/javascripts/ajaxify.js
noodall-ui-0.0.2 public/javascripts/ajaxify.js