Search code examples
jquerygoogle-chromebackbone.js

List of valid Backbone.js DOM events


I'm reading a Backbone.js code from an example and I thought of the Event Listener Breakpoints(image include) in Chrome Dev tools. Am I right that the event listener values in Chrome Dev tools are the ones that I can write in events property of my code?

For example:

events: {
  'dblclick label': 'edit',
  'keypress .edit': 'updateOnEnter',
  'blur .edit': 'close',
  'DOMActivate .someclass': 'activateDom', // saw it in DOM Mutation
  'WebGL Error Fired .anotherClass': 'fireWebGLError' // saw it in WebGL
}

Events from Chrome DevTools under Source tab

If not, where can I find the list of all valid events that we can put?


Solution

  • backbone uses jQuery event delegation when jquery is available, else one of few similar libraries (which I haven't used) can be used as well in place of jQuery. So should be supporting the events that the browser & DOM manipulation library of your choice supports.

    If chrome supports a specific event, you should be able to listen to it, and the code will work in chrome but not in other browsers as expected.

    As far as I know, Backbone by itself doesn't limit the DOM events that you can listen to.

    You can find a list of standard events @ MDN