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.5.15 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.14 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.13 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.12 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.11 app/assets/javascripts/ajaxify.js
noodall-ui-0.4.11 public/javascripts/ajaxify.js
noodall-ui-0.4.10 public/javascripts/ajaxify.js
noodall-ui-0.5.10 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.9 app/assets/javascripts/ajaxify.js
noodall-ui-0.4.9 public/javascripts/ajaxify.js
noodall-ui-0.5.8 app/assets/javascripts/ajaxify.js
noodall-ui-0.4.8 public/javascripts/ajaxify.js
noodall-ui-0.4.7 public/javascripts/ajaxify.js
noodall-ui-0.5.7 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.6 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.5 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.4 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.3 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.2 app/assets/javascripts/ajaxify.js
noodall-ui-0.5.1 app/assets/javascripts/ajaxify.js