separate function with Javascript code to set Timeout? - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window setTimeout

Description

separate function with Javascript code to set Timeout?

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*w  w  w.  jav a  2s  .  c om*/
function my()
{
    this._timeout = function(){
        setTimeout(function(){
            comparePanel();
        }, 3000);
    };
}
function comparePanel()
{
     console.log('hi');
}
var toc = new my();
toc._timeout();
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials