ErichBSchulz ErichBSchulz -4 years ago 127
jQuery Question

can you use backbone listenTo with jquery objects?

Such as those returned by


For example, can:

$('#div').on(event, callback)

be re-written as:

view.listenTo($('#div'), event, callback)

Answer Source

No it turns out you can't.

You've got jQuery for that.

According to tgriesser

Sorry, listenTo only applies to objects that have the Backbone.Events mixed in, so it would work on a Backbone.View, Backbone.Collection, or Backbone.Model, but not on a jQuery object.


Some folk also suggest creating a backbone view rather than using jquery events.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download