Sha256: 637b7c76f29bb8504e4cf9b9b8c4afa99832ba9d7370673374c3e3d3023e22d2

Contents?: true

Size: 545 Bytes

Versions: 11

Compression:

Stored size: 545 Bytes

Contents

$.ajaxFormHandlers = {};

$.extend({
  registerAjaxFormHandler: function(handlers) {
    $.extend($.ajaxFormHandlers, handlers);
  }
});

$("form.ajaxify").live("submit", function(event) {
  var form = $(this);

  $.ajax({
    type: form.attr("method") || "GET",
    url : form.attr("action") || window.location.href,
    data: form.serialize(),
    success: function(response) {
      var handler = $.ajaxFormHandlers[form.attr("name")];
      if (handler) {
        handler(form, response);
      }
    }
  });

  event.preventDefault();
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rich_cms-3.0.2 assets/jzip/jquery/extensions/ajaxify.js
rich_cms-3.0.1 assets/jzip/jquery/extensions/ajaxify.js
rich_cms-3.0.0 assets/jzip/jquery/extensions/ajaxify.js
rich_cms-2.1.7 assets/jzip/jquery/extensions/ajaxify.js
rich_cms-2.1.6 assets/jzip/jquery/extensions/ajaxify.js
rich_cms-2.1.5 assets/jzip/jquery/extensions/ajaxify.js
rich_cms-2.1.4 assets/jzip/jquery/extensions/ajaxify.js
rich_cms-2.1.3 assets/jzip/jquery/extensions/ajaxify.js
rich_cms-2.1.2 assets/jzip/jquery/extensions/ajaxify.js
rich_cms-2.1.1 assets/jzip/jquery/extensions/ajaxify.js
rich_cms-2.1.0 assets/jzip/jquery/extensions/ajaxify.js