Is binding events using JQuery’s bind() considered better than simply doing the onclick=’bla(this)’ and why ?
Thanks !
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because Unobtrusive JavaScript (UJS) is the new normal.
For me, the separation of markup from behavior is the biggest benefit, although there are other things that are handy about it, and everyone likes different aspects.
@Esailija correctly points out that jQuery makes UJS much easier, in terms of level of work, browser compatibility, browser workarounds, and so on. UJS doesn’t depend on jQuery, but JS libraries have made it viable across a wider swath of functionality.