This is my first experience with SPA, as well as first time learning Durandal, and I'm still adjusting to the SPA concept that there's just 1 HTML page with constant DOM manipulation. I'm concerned with things colliding with each other, not from a JS persepctive, since all JS code is modularized, but more from a markup/css/jquery selector perspective, and how html is managed in the DOM. Can anyone help with these questions:
1. when a view is "swapped out" for another view, is the original kept in the DOM hidden? Or is it physically removed from the DOM and stored somewhere as a string representation to be inserted back again if needed?
2. If I'm using JQuery selectors in my vm, selecting by either an attribute or class, will hits be limited to the current view? Or will I get hits from other views that may already have been loaded? (assuming they're still in the DOM hidden). Likewise for events that may be bound to a css class. Will those events fire for elements not in the current view?
3. I know putting <style> sections directly in the html is not best practice, but if I have those in multiple views, will the styles be applied only to the view they're defined in, or could the styles leak out into other views (i.e. they become "global")?
thanks