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






<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>








29.7.connect
29.7.1.Connect animation
29.7.2.Connect two animations
29.7.3.Connect two functions together
29.7.4.Add event to a button with dojo.connect
29.7.5.Add event to a tag with dojo.connect