I want to change only <p> tag contents using javascript after a defined time delay. For example a
<p>messages</p>
should change depending on the no. of new messages came. As
<p>messages(1)</p>
<p>messages(2)</p>
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.
Write your
<p>as:Your javascript:
Where
1000is the number of milliseconds to delay.Or if you want to do it periodically every 15 seconds, you can use
setInterval:UPDATE:
I see your comment above:
In that case, I gather you want to retrieve that periodically, in effect polling that URL? If you already use a javascript framework, I suggest you look at their
AJAXdocumentation.