]> git.mxchange.org Git - mailer.git/blobdiff - js/ajax-common.js
AJAX installer fixed:
[mailer.git] / js / ajax-common.js
index 113864a9ee58b7b626fcba27c4034058b76bd9d6..1e19561fa1f07c388c66150c3065ab6fbd6e44ec 100644 (file)
@@ -152,25 +152,19 @@ function setAjaxSuccess (success) {
 
 // Set AJAX reply and decode JSON if requested
 function setAjaxReply (reply, isJson) {
-       // Copy reply to local variable
-       var localReply = reply;
-
        // Is it JSON URL-encoded content?
        if ((isJson != undefined) && (isJson == true)) {
-               // Then decode it, replace '%20' with space before because '%20' breakes JSON content
-               var obj = jQuery.parseJSON(reply.replace('%20', ' '));
+               // Decode URL-encoding (for some reason it must be here ...)
+               var localReply = decodeUrlEncoding(reply);
 
-               // Is reply_content there
-               if (obj.reply_content == undefined) {
-                       // Not defined
-                       throw new 'obj.reply_content not returned from ajax.php, please fix your scripts.';
-               } // END - if
+               // Then decode it, replace '%20' with space before because '%20' breakes JSON content
+               var obj = jQuery.parseJSON(localReply.replace('%20', ' '));
 
                // ... and set it
-               setAjaxDecodedContent(obj.reply_content);
+               setAjaxContent(obj);
        } else {
                // Handle the content over to decode it
-               setAjaxDecodedContent(localReply);
+               setAjaxDecodedContent(reply);
        }
 }
 
@@ -272,7 +266,7 @@ function requestAjaxContent (prefix, htmlId, tabId, footerNavigation) {
                // Fade the old content out
                $('#' + htmlId).fadeOut('fast', function() {
                        // Send AJAX request
-                       if (sendAjaxRequest(prefix, 'request_content', '&tab=' + tabId, true) == true) {
+                       if (sendAjaxRequest(prefix, 'request_content', '&tab=' + tabId, false) == true) {
                                // Add the HTML content
                                $('#' + htmlId).html(getAjaxContent());