Notes on learning jQuery


Notes on learning jQuery

Published on Sun 02 Dec 2007 03:12 ( 2 years, 3 months ago)
Javascript Learning notes

Some guys like jQuery over prototype, I used prototype before and only take a look at jQuery from time to time, today I read documents more carefully and follow the tutorials and wrote a few line test codes.

  again, this is leaning notes, correct me if I am wrong.

  • "get element by selector" sugars

jQuery provides a super set of get element by selector.  "getElementbySelector" is super cool idea, I saw this technic in 2005 when I found "behaviour.js". Unfortunately, the idea of behaviour.js was very cool but the performance is slow in large web pages. 

Now prototype.js also support this very well.

The disadvantage is still there -- slow.

  • "chains"

Chains make code less and neat. jquery functions always return javascript objects, so it's easier to chain multiple lines into one.

I personally don't like this idea. it's looks nice, but the code will not easy to maintain and the not that easy to read. There are too much implicit information in this "chaining".  ofcoz, that's my personal opinions.

$('<p></p>')
.html('Hello World!')
.css('background', 'black')
.appendTo("body");


  • plugin


I like this plugin idea in jquery. user can even add customized selector provider through plugin, that's nice.

$.fn.donothing = function(){
return this;
};


  • Ajax


ofcoz, every one have ajax part... every one are similar...


jQuery is cool, however I still like prototype, it's not because good or bad, just because the old habit.


Related posts:


Search related in web:

Custom Search

RSS Feed

One click subscribe this blog in your google reader!

Be social!


Want to say something here? please sign in



Blog posts link to this page
What are friends tweeting?
Tags cloud
Monthly Archives