invoke the function defined in prototype of a function? - Javascript Object

Javascript examples for Object:Object Property

Description

invoke the function defined in prototype of a function?

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() {/*from w  ww  .  j  a v  a 2s  . c  o  m*/


my = {};

my.MyObject = function(config) {};
my.MyObject.prototype.hello = function() {
    console.log("Hello");
};

var MyObject = new my.MyObject({});
MyObject.hello();


    });

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

Related Tutorials