In JavaScript, How can I call a function after a specific time interval?
Here is my function I want to run:
function FetchData() {
}
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.
You can use JavaScript Timing Events to call function after certain interval of time:
This shows the alert box every 3 seconds:
You can use two method of time event in javascript.i.e.
setInterval(): executes a function, over and over again, atspecified time intervals
setTimeout(): executes a function, once, after waiting aspecified number of milliseconds