David Mark's Javascript Tip of the Day

D

David Mark

David Mark's Javascript Tip of the Day

Volume 1 - Tip 3A

For God's sake, don't use jQuery under any circumstances.

http://pengbos.com/blog/a-bug-in-jquery-latest-releasev1-6-2

Not fast, not concise, just creates a whole lot of confusion for no
good reason. Google combinations of: "jQuery", "attr", "prop",
"removeAttr", and now "removeProp" (!) and find lots of similar tales.
The "attr" variety is old news, the others were recently added to try
to fix the problems it created.

The client above just needed code like this:-

el.readOnly = b; // That's all

....instead they spent what appears to be hours slogging through
jQuery's muck.

The common recurring theme is that nobody associated with the project
seems to understand what these functions do or how to design
alternatives that make sense. Meanwhile, entire books and blogs about
jQuery are "right" one day and "wrong" the next as jQuery fiddles
endlessly with their core DOM code. Virtually every jQuery example
ever written makes at least one call to "attr".

http://www.cinsoft.net/
http://twitter.com/cinsoft
http://jsperf.com/browse/david-mark
 
J

Jukka K. Korpela

It is helpful to include some relevant quotes from such links

I thought that what followed the URL in David Mark's post _was_ a
quotation or paraphrase of its key contents. I still think it was meant
to be a paraphrase, but this is not quite clear. In any case, when
mentioning a URL, it is usually a good idea to quote its heading or
title, such as
"A Bug in JQuery Latest Release(v1.6.2)"
It's not a good heading, but it's what the page has. Quite often, when a
URL has been killed (by a reorganization of a site, or by moving a
resource to another server), googling for the exact title helps to find
the new address of the resource fast.
 
D

David Mark

It is helpful to include some relevant quotes from such links as they
may not last as long as this post and some readers are blocked from
accessing "social media" sites because their boss/supervisor/spouse/
whatever fears they'll spend their day socialising.

Yes, but not a lot of salient quotes there though. Even though the
author is clearly confused about... well, almost everything, that
wasn't really my point.
 
D

David Mark

11/8/2011 2:26 AM, RobG wrote:




I thought that what followed the URL in David Mark's post _was_ a
quotation or paraphrase of its key contents.

Yes. It was a high altitude view, but more of the general
implications than the specific outcome. In short, there's no way that
all of those jQuery users out there having problems with attr/prop/
etc. are saving time or learning anything useful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top