I need to update my page automatically without refreshing it with Ajax. But so far I have seen is that people use jQuery and PHP, and I'm not that good at coding. So what I need to do is to add Ajax to HTML without adding PHP or jQuery. Pages where I found something similar, but all of them uses jQuery: ajax jquery update page without refreshing Update data on a page without refreshing http://api.jquery.com/load/ Thank You
Asked
Active
Viewed 314 times
0
-
Possible duplicate of [How to make an AJAX call without jQuery?](https://stackoverflow.com/questions/8567114/how-to-make-an-ajax-call-without-jquery) – Roman Koliada Dec 08 '17 at 13:08
-
4If you are going to use ajax and you are not good at coding, then use jquery. – Juan Dec 08 '17 at 13:08
-
It's better if you try it with jquery... It's not this difficoult... – DaFois Dec 08 '17 at 13:08
-
Could someone explain how jquery works? Because how I understood is that you can not add jquery right to html, and I need to do – Beginner Dec 08 '17 at 13:16
1 Answers
-1
<script>
setInterval(function(){ location.reload(); },5000);
</script>
Put this snippet in your desired HTML page. This setInterval() function refresh the page every 5 second.
-
setInterval don't has sense if you make the page reload. It should be setTimeout. Also, if you have a slow connection/busy server and it lasts more than 5 seconds to reload the page, setInterval will keep restarting the reload, without even reloading. – Jorge Fuentes González Jan 21 '18 at 23:38