Last Updated: February 25, 2016
·
814
· kaareal

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.

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside