I need to implement a feature where the page refreshes only after the user clicks the "OK" button on a dialog box that appears once a process is completed.
The issue I'm facing is that in my current code, the page refreshes immediately after the process completes, without waiting for user interaction.
Below is the code snippet I am currently working with:
$.ajax({
type: "POST",
url: wsurl + "BackendRequest",
data: '{ sDomain : "' + domain + '", sUserName : "' + username '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
document.getElementById('btnGenerate').disabled = true;
showDialogPopup('Generate Request', data.d);
//window.location.reload();
},
error: function (objXMLHttpRequest, textStatus, errorThrown) {
showDialogPopup('Generate Request', data.d);
//window.location.reload();
}
});
The challenge is to find a way to trigger the page refresh only when the user interacts with the dialog box and clicks the "OK" button in the showDialogPopup
method.