I wanted to make a system where we have a blank page and when something was placed in a database table, JavaScript would automatically display the result on the page without giving refresh, ie without giving f5 on the page.
How do I do this?
I wanted to make a system where we have a blank page and when something was placed in a database table, JavaScript would automatically display the result on the page without giving refresh, ie without giving f5 on the page.
How do I do this?
You can try the following: Use the setInterval () method to call a script via AJAX every x period. Ajax content can be loaded anywhere on the page without the need to reload it within a div for example.
One way to implement this is to create two files:
A - A main html file, which will contain the DIV where the AJAX content will be loaded and the javascript code that will call the AJAX every X period of time.
B - A php file that will be called via ajax and will query and return the contents of the database.
I hope I have helped!