In Internet Explorer 10, the setInterval function does not work properly. I have a web page where, upon form submission, a lengthy process is triggered on the server to download a file. To keep users updated on the progress, I utilize setInterval to repeatedly check the server for progress.
The ProgressServlet is only called once throughout the process. Due to company restrictions, I haven't been able to test this functionality on any other web browser.
<script>
var myVar;
function validateForm()
{
//validation logic omitted
myVar = setInterval(getProgress(), 1000);
return true;
}
function getProgress() {
//ProgressServelt will return progress of the long process on the server
$.get("ProgressServlet", $.now(), function(res) {
if (res != "9999" || res == "No value avaliable") {
$("#progress").html(res);
} else {
$("#progress").html("Stopped: " + res);
clearInterval(myVar);
}
});
}
</script>
<form method="post" action="CreateServlet" name = "create">
Change Number(s):<br>
<input type="text" name="change" id="change">
<p></p>
<input type="submit" value="Download" onClick="return validateForm()">
</form>
<p></p>
<button id="send" name="send">Display</button>