diff --git a/js/jquery.form.js b/js/jquery.form.js index 2b853df428..14e14572af 100644 --- a/js/jquery.form.js +++ b/js/jquery.form.js @@ -1,6 +1,6 @@ /*! * jQuery Form Plugin - * version: 2.49 (18-OCT-2010) + * version: 2.63 (29-JAN-2011) * @requires jQuery v1.3.2 or later * * Examples and documentation at: http://malsup.com/jquery/form/ @@ -54,7 +54,8 @@ $.fn.ajaxSubmit = function(options) { options = { success: options }; } - var url = $.trim(this.attr('action')); + var action = this.attr('action'); + var url = (typeof action === 'string') ? $.trim(action) : ''; if (url) { // clean url (don't include hash vaue) url = (url.match(/^([^#]+)/)||[])[1]; @@ -63,7 +64,7 @@ $.fn.ajaxSubmit = function(options) { options = $.extend(true, { url: url, - type: this.attr('method') || 'GET', + type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57) iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' }, options); @@ -167,7 +168,7 @@ $.fn.ajaxSubmit = function(options) { } } else { - $.ajax(options); + $.ajax(options); } // fire 'notify' event @@ -189,15 +190,7 @@ $.fn.ajaxSubmit = function(options) { var s = $.extend(true, {}, $.ajaxSettings, options); s.context = s.context || s; var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id; - window[fn] = function() { - var f = $io.data('form-plugin-onload'); - if (f) { - f(); - window[fn] = undefined; - try { delete window[fn]; } catch(e){} - } - } - var $io = $('