14 ms·
What's wrong with putting a single, reusable function call in onclick? <a href="/posts/1244/comments/new" onclick="Comment.new(this); return false;">New Co
by epochwolf 15y ago
What's wrong with putting a single, reusable function call in onclick?
<a href="/posts/1244/comments/new" onclick="Comment.new(this); return false;">New Comment</a>
- lazerwalker 15y agoIf nothing else, it goes against the author's own rule of never using eval, albeit in this case it's an implied eval rather than explicit call to the eval() function.
- bdg 15y ago1. Pollutes the DOM 2. Violates separation of concerns 3. Complicates maintainability 4. Events are bound directly to elements rather than bubbling and being managed via delegation.
- mayanksinghal 15y agoI don't use use onclicks either but from the source of this page: onclick="return vote(this)"
- jonah 15y agoThis page uses tables too. [edit] my point was to not take this site as an example of best-practices...