setTimeout(function(){ alert("Sup!"); }, 2000);//wait 2 seconds
// Redirect to index page after 5 sec setTimeout(function(){ window.location="index"; },5000);