I have a simple task – retrieve click listener function from DOM element. I’ve fased two problems: I have no idea how to obtain event listener, that was set via addEventListener function $(element).data(‘events’) is always empty Talking about first problem – I think it’s not critical as I’m using this function only in one place. But the second problem is
Tag: backbone.js
In Javascript, what does this underscore mean?
I’m reading a tutorial on backbone.js here: http://addyosmani.com/blog/building-spas-jquerys-best-friends/ What are the underscores? (_index, _photos, _album) Why use them? Answer It means private fields or private methods. Methods that are only for internal use. They should not be invoked outside of the class. Private fields contain data for internal use. They should not be read or written into (directly) from outside
Backbone js: register view events on parent element
I’d like to register view events on the view parent element. I tried the parent selector: But it is not working. How can I achieve this? Answer Backbone uses jQuery event delegate, so you can’t delegate events to the parent node. see in Backbone source code line 954, the View.delegateEvents function.
Backbone View events not firing
I am using Rails3 as my backend and Jammit to asset… Now I am trying to not compress and even package the assets. The simple event don’t get run, but the alert(‘asd’) int initialize is working as expected. I have already tried other kinds of events in other objects too, but it didn’t work. My code as follow: and my
What is the purpose of backbone.js?
I tried to understand the utility of backbone.js from its site http://documentcloud.github.com/backbone, but I still couldn’t figure out much. Can anybody help me by explaining how it works and how could it be helpful in writing better JavaScript? Answer Backbone.js is basically an uber-light framework that allows you to structure your Javascript code in an MVC (Model, View, Controller) fashion