Script:
function retrievePageStatus(pageNumber)
{
showMessageHtml('messageDiv', "Retrieving page status for page " + pageNumber);
var url = getURLString(pageForm);
var urlstr = "importTemplate.do?userAction=retrieveStatus&"
+ url.substring(0, url.length - 1);
ajaxFunction();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
document.getElementById('messageDiv').style.display = 'none';
if (xmlHttp.responseText == "success") {
alert("Page status retrieved successfully for page " + pageNumber);
} else {
alert("Error while retrieving page status for page " + pageNumber + ": " + xmlHttp.responseText);
}
returnToPageUrl("page?pageId=" + pageId
+ "&opType=entry&modType=add&menuNavigationId="
+ menuNavigationId + "&menuPageId=" + pageId);
}
}
}
xmlHttp.open("POST", urlstr, true);
xmlHttp.setRequestHeader("Content-Type", "application/plain");
xmlHttp.send(null);
}
I need help in calling the above script repeatedly to retrieve page status based on page number passed from the service layer function. Any assistance would be greatly appreciated.