|
1 | 1 | /*!
|
2 | 2 | * jQuery Form Plugin
|
3 |
| - * version: 2.82 (15-JUN-2011) |
| 3 | + * version: 2.84 (12-AUG-2011) |
4 | 4 | * @requires jQuery v1.3.2 or later
|
5 | 5 | *
|
6 | 6 | * Examples and documentation at: http://malsup.com/jquery/form/
|
@@ -50,7 +50,7 @@ $.fn.ajaxSubmit = function(options) {
|
50 | 50 | return this;
|
51 | 51 | }
|
52 | 52 |
|
53 |
| - var method, action, url, $form = this;; |
| 53 | + var method, action, url, $form = this; |
54 | 54 |
|
55 | 55 | if (typeof options == 'function') {
|
56 | 56 | options = { success: options };
|
@@ -91,7 +91,7 @@ $.fn.ajaxSubmit = function(options) {
|
91 | 91 | if (options.data) {
|
92 | 92 | options.extraData = options.data;
|
93 | 93 | for (n in options.data) {
|
94 |
| - if(options.data[n] instanceof Array) { |
| 94 | + if( $.isArray(options.data[n]) ) { |
95 | 95 | for (var k in options.data[n]) {
|
96 | 96 | a.push( { name: n, value: options.data[n][k] } );
|
97 | 97 | }
|
@@ -188,12 +188,14 @@ $.fn.ajaxSubmit = function(options) {
|
188 | 188 |
|
189 | 189 | // private function for handling file uploads (hat tip to YAHOO!)
|
190 | 190 | function fileUpload(a) {
|
191 |
| - var form = $form[0], i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; |
| 191 | + var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; |
| 192 | + var useProp = !!$.fn.prop; |
192 | 193 |
|
193 | 194 | if (a) {
|
194 | 195 | // ensure that every serialized input is still enabled
|
195 | 196 | for (i=0; i < a.length; i++) {
|
196 |
| - $(form[a[i].name]).attr('disabled', false); |
| 197 | + el = $(form[a[i].name]); |
| 198 | + el[ useProp ? 'prop' : 'attr' ]('disabled', false); |
197 | 199 | }
|
198 | 200 | }
|
199 | 201 |
|
|
0 commit comments