3
Whoa, everybody, all right?
Next, I’m doing an administrative area and would like the content to update dynamically without the need to refresh the page to see if there’s anything new. For example, if the administrator is on the order page and enters a new request, I would like the table to already update and display this new request, without having to load the page to see if you have something new.
Or if you are not on the order page, a notification would appear, as you have here on stackoverflow or facebook, etc..
I tried looking for something like this, but I haven’t found anything yet. The languages I’m using are: PHP (database), JSON (pass the database to the website), Jquery/AJAX to make things dynamic and HTML/CSS.
I have the functional codes to read the DB, create the JSON, write the tables on the site etc.. I just couldn’t make these dynamic updates and notification system, no need for refresh.
Can anyone help me with this? How to get started? Any reference links for me to learn this? I know a little Jquery/Ajax, but nothing advanced.
Thank you.
Edit: I’ve been searching and found this code in Jquery:
var $container = $("#mytable");
var refreshId = setInterval(function()
{
$container;
console.log("loaded");
}, 10000);
However it is not working. It loads the div, the console shows that it has been loaded, but the table does not update with the new values.