What would be the easiest way to update a HTML tag with the following php code?
<h1>
<?php
include "document.txt";
?>
</h1>
What I mean is like a timed update… every 10 second or every 2 seconds.
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.
Take a look at AJAX. jQuery has a really easy to use function to make AJAX requests, see
jQuery.ajax().This example (modified from the jQuery page) is what you want:
It’ll get the contents of the
document.txtfile and add it to an element with the attributeid="results"like the following:You can then use
window.setIntervalto execute the code at a set interval.