Skip to content

Commit 8434a5f

Browse files
committed
Makes ajaxSubmit with target compatible with jQuery>=1.12.1
fixes #495
1 parent 88b8fe5 commit 8434a5f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/jquery.form.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,13 @@
243243
if (!options.dataType && options.target) {
244244
var oldSuccess = options.success || function(){};
245245

246-
callbacks.push(function(data) {
247-
var fn = options.replaceTarget ? 'replaceWith' : 'html';
246+
callbacks.push(function(data, textStatus, jqXHR) {
247+
var successArguments = arguments,
248+
fn = options.replaceTarget ? 'replaceWith' : 'html';
248249

249-
$(options.target)[fn](data).each(oldSuccess, arguments);
250+
$(options.target)[fn](data).each(function(){
251+
oldSuccess.apply(this, successArguments);
252+
});
250253
});
251254

252255
} else if (options.success) {

0 commit comments

Comments
 (0)