Global $selectors are as bad as global vars
For any widget, backbone view ... always write dom centric code, never select elements outside the widget boundary.
Makes it much easier to debug, and maintain and avoid issues where the dom tree has been changed without your widget know about it.
Written by Kaare
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#