DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
  • Infrastructure
    • can-construct
    • can-control
    • can-event
      • static
        • addEventListener
        • bind
        • delegate
        • dispatch
        • listenTo
        • off
        • on
        • one
        • removeEventListener
        • stopListening
        • trigger
        • unbind
        • undelegate
    • can-event/async/async
    • can-event/batch/batch
    • can-observation
    • can-simple-map
    • can-util
    • can-view-callbacks
    • can-view-live
    • can-view-model
    • can-view-nodelist
    • can-view-parser
    • can-view-scope
    • can-view-target
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Infrastructure
  • /
  • can-event
  • /
  • delegate
  • / On this page
    • delegate

      function
      • source

      obj.delegate(selector, event, handler)

      Provides a compatibility layer for adding delegate event listeners. This doesn't actually implement delegates, but rather allows logic that assumes a delegate to still function.

      Therefore, this is essentially an alias of addEventListener with the selector ignored.

      Parameters

      1. selector {String}:

        The ignored selector to use for the delegate.

      2. event {String}:

        The name of the event to listen for.

      3. handler {function}:

        The handler that will be executed to handle the event.

      Returns

      {Object}:

      this

      canEvent.delegate.call(obj, selector, event, handler)

      This syntax can be used for objects that don't include the [can.event] mixin.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.