{ Lekker Logic }

Technology Solutions

Ajax refresh PHP on Interval

Here is a quick little snippet on refreshing a PHP script into an HTML page element using AJAX and automating it with setInterval:

Here we run the prices() function, GET the load_prices.php file and then upon success place the response into the #prices <div> element on the page.  The automate potion is handled by setInterval and triggered every 600,000 milliseconds. Easy!

 

Lekker Logic
Tags: AJAX, functions, HTML, Javascript, PHP, Programming, Tutorials