Hi i want to send request in to my php file in every x seconds using ajax how can i achieve this
Here is my ajax code
<script type="text/javascript">
function fun()
{
var exam=new XMLHttpRequest();
exam.onreadystatechange=function()
{
if(exam.readyState==4)
{
document.getElementById("content").innerHTML=exam.responseText;
}
}
exam.open("GET","rat_test.php?name=pramod",true);
exam.send(null);
}
</script>
How can i get my goal
Any help will be appreciated