From ad3c58f2d875a0ac7a8a17372c7eca84abd1a2b3 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Mon, 15 Apr 2019 14:01:34 +1200 Subject: [PATCH] BUG Back-port https://github.com/silverstripe/silverstripe-admin/pull/769 to 3.7, fix parsererror issue --- javascript/jquery-ondemand/jquery.ondemand.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/javascript/jquery-ondemand/jquery.ondemand.js b/javascript/jquery-ondemand/jquery.ondemand.js index 0437c953e..62fd837ad 100644 --- a/javascript/jquery-ondemand/jquery.ondemand.js +++ b/javascript/jquery-ondemand/jquery.ondemand.js @@ -109,10 +109,13 @@ $.ajax({ dataType: 'script', url: newJsInclude, - success: function() { + complete: function() { self._ondemand_loaded_list[newJsInclude] = 1; getScriptQueue(); }, + error: function(xhr, status, error) { + console.error(error); + }, cache: false, // jQuery seems to override the XHR objects if used in async mode async: false