// 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);
}
}
// 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());
//* DEBUG: */ alert('doFooterPage(): button=' + button + ',currentTabId=' + currentTabId + ',nextPage[currentTabId]=' + nextPage[currentTabId]);
if ((button == 'next') && (nextPage[currentTabId] != null)) {
// Then call the AJAX requester
- requestAjaxContent(prefix, htmlId, nextPage[currentTabId]);
+ var page = nextPage[currentTabId];
} else if ((button == 'previous') && (previousPage[currentTabId] != null)) {
// Then call the AJAX requester
- requestAjaxContent(prefix, htmlId, previousPage[currentTabId]);
+ var page = previousPage[currentTabId];
}
+
+ // Request AJAX content
+ requestAjaxContent(prefix, htmlId, page);
+
+ // Change the footer navigation
+ enableFooterNavigation(prefix, page);
}
// Allows to save made changes (this will be called if the onchange event has been triggered)