Tuesday, April 26, 2011

Stop loading page load for few seconds using JavaScript


Add below JavaScript function under head tag of your .aspx page.
 <script type="text/javascript">
  
 function DelayAlert()
  
 {
  
 alert("Page will load after 30 seconds");
  
 }
  
 function DelayPageLoad()
  
 {
  
 setTimeout("DelayAlert()", 30000);
  
 }
  
 </script>
  
You can call above function from body onload like below,

 <body onload="DelayPageLoad">
  
 //page content goes here...
  
 </body>  

No comments: