I am using display view that uses app.js file.In this I retrieve data from database and display using some api in app.js . I need to reload the display automatically evey say, 5 sec.I don’t want page be refreshed but be updated.There is div with ‘mydiv’ which holds the display contents.How can I accomplish this?
Share
This can be done using JavaScript.
To refresh a div every n minutes, you can use setInterval method to call a function every n miliseconds.
This function should make ajax request to get data from server and insert the data in HTML.
Below code uses jQuery but you can use any other library to get the result.