From 134c6f6ec130c36f123ba904f546dd2d939df569 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 25 Feb 2016 15:34:02 +0900 Subject: [PATCH] Fix jshint warnings and also apply patches to exec_json() --- common/js/xml_handler.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/common/js/xml_handler.js b/common/js/xml_handler.js index 5d0d9a940..c5a54d6d5 100644 --- a/common/js/xml_handler.js +++ b/common/js/xml_handler.js @@ -134,11 +134,13 @@ // Hide the waiting message and display an error notice. clearTimeout(wfsr_timeout); waiting_obj.hide().trigger("cancel_confirm"); + var error_info; + if ($(".x_modal-body").size()) { - var error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")" + "

" + xhr.responseText + "
"; + error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")" + "

" + xhr.responseText + "
"; alert("AJAX communication error while requesting " + params.module + "." + params.act + "

" + error_info); } else { - var error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")" + "\n\n" + xhr.responseText; + error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")" + "\n\n" + xhr.responseText; alert("AJAX communication error while requesting " + params.module + "." + params.act + "\n\n" + error_info); } }; @@ -232,8 +234,15 @@ var errorHandler = function(xhr, textStatus) { clearTimeout(wfsr_timeout); waiting_obj.hide().trigger("cancel_confirm"); - var error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")"; - alert("AJAX communication error while requesting " + params.module + "." + params.act + "\n\n" + error_info); + var error_info; + + if ($(".x_modal-body").size()) { + error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")" + "

" + xhr.responseText + "
"; + alert("AJAX communication error while requesting " + params.module + "." + params.act + "

" + error_info); + } else { + error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")" + "\n\n" + xhr.responseText; + alert("AJAX communication error while requesting " + params.module + "." + params.act + "\n\n" + error_info); + } }; // Send the AJAX request.