User-2054057000 posted
You will have to use .ajax()
method to do this kind of work. You will also need to run your JavaScript code every 5 seconds time so that you can do the checking purpose.
For this you will need to use
.setInterval()
method of JavaScript.
The code skeleton will look like:
setInterval(checkService, 5000);
function checkService() {
//here make AJAX call
$.ajax({
type: "POST",
url: "",
data: {},
success: function (msg) {
},
error: function (req, status, error) {
}
});
}