Connect two functions together : connect « Dojo toolkit « JavaScript DHTML






Connect two functions together

 

<html>
  <head>
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/"
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
  </head>
  <body>
    <script>
      function MyClass() {
        this.sayHello = function(inName) {
          alert("old: " + inName);
        }
      }
      function interceptor(inName) {
        document.write("new: " + inName);
      }
      var myObject = new MyClass();
      dojo.connect(myObject, "sayHello", null, interceptor);
      myObject.sayHello("A");
    </script>
  </body>
</html>

   
  








Dojo-toolkit.zip( 3,849 k)

Related examples in the same category

1.Connect animation
2.Connect two animations
3.Add event to a button with dojo.connect
4.Add event to a tag with dojo.connect