Following up on some previous posts on how you can improve your development process, your website, add modern functionality and interactions to your site, I would like to present yet another thing that can make your life as a webmaster even nicer: jQuery “The write less, do more, JavaScript library” enables you to add tons of cool functionality to your site, with few simple steps.
jQuery is basically a library that allows you to add effects and behavior to elements on your website. This could for example be making a list sortable, adding effects to DOM elements and more. What makes jQuery so popular is it’s ease to use. Allow me to show this example – taken from the jQuery front page – to illustrate it’s ease:
$("p.neat").addClass("ohmy").show("slow");
What this simple piece of code does, it that it selects the <p> tag with the class “neat” and assigns the class “ohmy” to it, whereafter it displays it. And this is just the beginning… A whole lot of plugins are also available, making this an even more attractive library.
Let this article be a short presentation and teaser ;-) I will follow up with some more examples in the future.
10 comments (leave a comment)
Hey thanks for this info! ;)
Keep them comming xD
hehe.
by Jesse Manalansan on May 22, 2009 at 16:06
jquery rullz. I think it would be better if there where some links to demo’s. So here we go
http://www.pengoworks.com/workshop/jquery/autocomplete.htm
http://jquery.com/demo/thickbox/
And there more :D
by Parko on May 23, 2009 at 22:34
I normally don’t like javascript, because of the prosentage of users that also don’t like javascript and keep that turned off. And Firefox’s problems with javascript. I turn to PHP-solutions then I can.
by HAS on May 24, 2009 at 15:24
I like jquery especially for it’s easy ajax:
$(“#element”).load(“script.php”);
nice!
And Firefox has no problems with it.
by flower on May 30, 2009 at 09:04
HAS
you don’t know what you talkin about!
by volkan on May 31, 2009 at 16:17
Volkan, I think you shold back that up with a explanation instead on how to do it better.
by HAS on June 1, 2009 at 14:48
HAS,
I agree to a certain extent in that users often either do not like JS or even more so, have it blocked by their NoScript plugins, etc. I also first turn to PHP and if that fails, only then I will implement client side scripts.
On the other hand: what problems are you referring to when you say Firefox has issues with JS? I have used JS on many occassions and never really had any issues to be honest.
Regards
John
by John on June 4, 2009 at 09:18
I agree with John, never had any problems whatsoever with having JS running on Firefox. As for IE, that’s a whole other story. Perhaps Volkan (and others) were referring to conflicting jquery’s?
by Stijn on June 15, 2009 at 16:50
jQuery is awesome!
I used to use Prototype (another JavaScript library), but I like jQuery way better. Too bad they clashed (which they aren’t supposed to). Let there be easy JavaScript!
by Yves on June 16, 2009 at 19:32
I agree with the statement: “What makes jQuery so popular is it’s ease to use”. It definitely cannot be the quality of it’s code, that makes it so popular!
I always wonder why people, that in other ways seem interested in a good and modern code, will ‘pollute’ their code with old and invalid 4’th generation browser solutions – like jQuery. As every coder is expected to know, the innerHTML property belongs to the Explorer 4 and Netscape 4 browseres, where we didn’t have better methods of manipulating the elements in a webpage. The property has never been valid in _any_ standard for webcode and it can have a lot of very bad side effects, depending on the use.
Times have indeed changed! Why not use DOM? It’s not a tiny bit harder ;o)
According to ECMA 262 the ‘$’ character should only be used for ‘machine code’, while jQuery use the ‘$’ as name for it’s most essential function. It’s not illegal to use it for anything else … just not wise =)
Last, but not least, I wonder why some people strive to learn a whole new and proprietary syntax to write something, they could have written in quite easy and straight forward JavaScript/DOM.
Sometimes life’s a weird place to be =)
by Ole on June 18, 2009 at 11:13