Does backbone.js inherently have a way for me to detect and react to a views 'on show' and 'on hide'?
Or do I need to manually implement this using JQuery?
Does backbone.js inherently have a way for me to detect and react to a views 'on show' and 'on hide'?
Or do I need to manually implement this using JQuery?
"essentially when a view (a page) is rendered" this is not a built in feature of backbone. You are the one defining a render
method, (if you even have one, backbone doesn't have a rule to have one) or whatever way in which your view renders, so backbone can't provide such event because it doesn't know how you render things.
So if you are using pure backbone you'll have to implement it according to how you render your views.
If you use something built on top of backbone like Marionette.js, then it has set rules about how view's are rendered, hence it can and does provide events as well as call backs such as onRender
, onBeforeRender
.