Is it possible to resend an ajax request continuously using pure javascript without any framework? Here is an example of how I am currently attempting to do it:
xmlhttp=new XMLHttpRequest();
xmlhttp.open("POST","demo_post2.asp",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("fname=Henry&lname=Ford");
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
// Looking for a way to resend the request until the page is closed
}