+ Start a Discussion
Scott0987Scott0987 

Perform action or method after 5 seconds

What I want to do is have a visualforce page that displays a simple text message something like "This page will close in 5 seconds" I then want to run a method or update a variable or something that will close the page.  I have used a method where you nest javascript in an output panel to get the page to close just not sure how to do the whole 5 second thing.  I am pretty good with visualforce and apex but have very little java knowledge.  Any help would be greatly appreciated.  

kranjankranjan

Hi Scott,

 

You should use setTimeout function fo javascript to achieve the same. check this out..

 

http://stackoverflow.com/questions/1190642/how-can-i-pass-a-parameter-to-a-settimeout-callback

 

Regards