Have a go hero refreshing the itemlist on a regular basis

If you were to access your tasklist from home and keep the application open and later access it from, for example, your work, any changes made to the list from work wouldn't be visible at home unless you refreshed the page manually. This is because there is nothing implemented to refresh the list of tasks regularly; it is refreshed only after some action is initiated by clicking a button.

How could you implement a regular refresh? Hint: in the first AJAX example, we encountered JavaScript's setInterval() method. Can you devise a way to let it replace the contents of the<div> element containing the list of tasks using the load() method?

An example implementation is available in tasklistajax2.js. You can either rename it to tasklistajax.js and run tasklist.py or run tasklist2.py.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.93.0