Possible duplicates:
jQuery Standards and Best Practices Javascript Best Practices
Upon learning that the website I wrote was skipping memory like crazy, I started trying to improve the way I write Javascript / jQuery code.
For example, instead of writing:
if ($('#elem').is(':checked'))
I can write:
if ($('#elem')[0].checked))
Directly interact with the DOM rather than using jQuery, as the average person improves speed, right?
As for memory leaks, should jQuery callbacks be considered as closures? If I reference an element in a callback, should I invalidate the link at the end of its use? Or will the browser take care of this for me?
, .