> jQuery is a language
It was a library last time I checked ; ).
> and as such requires you to read at least a bit
> of documentation or examples before starting.
Why? For me the sweetest thing about using jQuery has been it's 
intuitiveness right out of the box. When I started I just looked at some 
initial code samples (fancy API pages weren't around back then or I 
didn't know about them) and then was virtually able to 'guess' the 
jQuery functions I needed. Need to add a class? Hmm let me try 
addClass() - works, yeah! Now I want to remove an element from the DOM - 
oh remove() it is! So now I just need to check whether this element 
exists. Hm - exists() produces a fatal error. Let me search the docs:

    * 
http://docs.jquery.com/Special:Search?search=element+exists&fulltext=Search
      
<http://docs.jquery.com/Special:Search?search=element+exists&fulltext=Search>
    * 
http://www.google.com/search?q=site%3Adocs.jquery.com%20element%20exists&hl=en
      
<http://www.google.com/search?q=site%3Adocs.jquery.com%20element%20exists&hl=en>

At this point I would need to actually post to the group or read the 
complete API docs in detail to find that is() is the answer to the 
problem. Same goes for hasClass() I think.
> Maybe .is() and .length
> should be more prominently visible in the doc, but I see no point in
> adding the .exists() and .hasClass() cruft to the (beautiful) jQuery
> code. 
I think is() is beautiful as well and there is nothing wrong with 
.length. However both pose a certain barrier for something new-comers 
will possibly try to do quite often.

-- Felix
--------------------------
My Blog: http://www.thinkingphp.org
My Business: http://www.fg-webdesign.de


Fil wrote:
>
> jQuery is a language and as such requires you to read at least a bit
> of documentation or examples before starting. Maybe .is() and .length
> should be more prominently visible in the doc, but I see no point in
> adding the .exists() and .hasClass() cruft to the (beautiful) jQuery
> code.
>
> -- Fil
>

Reply via email to