Hello, I just want an example for study purposes. I want the page to update automatically, to make future chat, the page update asynchronously and also to refresh real-time page, where other people on the computer can see the data at the same time. All with enough doubt in Ajax with JQuery, so I'm asking the question. My question is related to function ...
I have the test.php file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
</style>
</head>
<body>
<div id="atualizar-assincrona"></div>
<script type="text/javascript" src="jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="ajax.js"></script>
</body>
</html>
I have the ajax.php file
$(function(){
$.ajax({
url: "ajax.php", // substitua por qualquer URL real
async: true
}).done(function () {
a = true;
});
});
Sorry but I do not know how to use this function, I need only a simple function to update the data without the user noticing. It may be either, but I understand JQuery but it has few subjects that teaches about ajax.
Update can be every 2 seconds ...