From abf9ba5f3696e522055a77af625e1e751cb69dbc Mon Sep 17 00:00:00 2001 From: Evans Edem Ladzagla <30314824+cmcgit@users.noreply.github.com> Date: Wed, 19 Sep 2018 13:44:06 +0000 Subject: [PATCH] ajax update ignored if ajax response is an object In asyncOnSuccess it checks whether ajax response is converted to an object. If so it ignores the ajax update codes --- src/jquery.unobtrusive-ajax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery.unobtrusive-ajax.js b/src/jquery.unobtrusive-ajax.js index 1598cc9..9725b14 100644 --- a/src/jquery.unobtrusive-ajax.js +++ b/src/jquery.unobtrusive-ajax.js @@ -47,7 +47,7 @@ function asyncOnSuccess(element, data, contentType) { var mode; - if (contentType.indexOf("application/x-javascript") !== -1) { // jQuery already executes JavaScript for us + if (contentType.indexOf("application/x-javascript") !== -1 || $.isPlainObject(data)){ // jQuery already executes JavaScript for us return; }