Is this possible? I need to get some data from another phpfile and I want it to appear every X seconds without you having to refresh the page.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, that is known as “polling” or “periodic refresh”
You can use
setInterval(see @Luca’s answer) and jQuery’s ajax API to communicate with the PHP file, and jQuery’s DOM manipulation API to change the contents of the page. In its simplest form: