Forum

Settimeout jquery -...
 

[Solved] Settimeout jquery - How to trigger function on page load by settimeout jquery


(@rahul)
Active Member
Joined: 1 year ago
Posts: 6
Topic starter  

Hi,

 

I want to trigger function after 10 sec, every time my html page is loaded. please help me to solve issue. my function name is calculate.

Thanks in advance.

 


   
Quote
Topic Tags
(@niraj)
New Member
Joined: 1 year ago
Posts: 4
 

Hi Rahul you can use JavaScript settimeout function for that, please find below code for your reference.

setTimeout(Calculate, 10000);
	function Calculate()
	{
		alert('Hello');
	}

 

As you can see setTimeout function is called on page load, whenever your page is loaded, setTimeout will be activated after that on 10th sec calculate function will be executed. which will show alert with 'Hello' text. You can write your own code to it.


   
ReplyQuote
(@rahul)
Active Member
Joined: 1 year ago
Posts: 6
Topic starter  

@niraj Thanks.


   
ReplyQuote
Share: