Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: "Christoph M. Becker" Newsgroups: comp.lang.javascript Subject: Re: jquery and hoi polloi Date: Thu, 11 Dec 2014 22:52:02 +0100 Organization: solani.org Lines: 24 Message-ID: References: <3e25f0fa-4c3f-4d51-a6a0-da69bd8b3677@googlegroups.com> <27938323-9eca-480c-8ead-2000865bcecc@googlegroups.com> <82684c28-b567-4b2c-8d2b-eb0c41376cd2@googlegroups.com> <43afda5d-d558-475d-bf46-4a9e69d99b8e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: solani.org 1418334715 13388 eJwFwYcBwDAIA7CXyrAh5ySM/0+oBKOwwgk6Fjs5iugBKJf4XlehI+vY6N5qnwVe0fRIJ38sFBGi (11 Dec 2014 21:51:55 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 11 Dec 2014 21:51:55 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 X-User-ID: eJwFwQkBwDAIA0BLUEhY5ZTPv4TdwaiscIKOxc5AQxffkcrajuCkW1HgkCfF5E1/bOOw+wcg7BFf In-Reply-To: <43afda5d-d558-475d-bf46-4a9e69d99b8e@googlegroups.com> Cancel-Lock: sha1:pWLMsfIRmOc2sl80V03gFmqBGuw= X-NNTP-Posting-Host: eJwNycERwDAIA7CVcAI2HYfCsf8Irb6KS7DlDHpsbOGMGyvi0dZRltf4pukqE3o56L962wDwAxEuEKQ= Xref: csiph.com comp.lang.javascript:26315 Cezary Tomczyk wrote: > There is nothing wrong with document.getElementById. However, if the > whole application is already using jQuery and then you'll start > "mixing" it with native JavaScript (in some places $(...) and in some > places getElementById) then you might get feedback from others that > you are breaking consistency of code. Good point. However, sometimes you have to use native APIs, because jQuery doesn't offer wrappers for all of them, anyway. And, for instance, the official "How to Create a Basic Plugin" tutorial[1] says: | Notice also that we're not using the .attr() method to retrieve the | href attribute, because the native DOM API gives us easy access with | the aptly named href property. ... and it saves you a dollar. ;) [1] -- Christoph M. Becker