Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

JavaScripting made simple

Friday, May 22nd, 2009 by Servage

jqueryFollowing 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.

JavaScripting made simple, 4.2 out of 5 based on 12 ratings
Categories: Cool stuff

Keywords: , , ,

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

10 comments (leave a comment)

Hey thanks for this info! ;)
Keep them comming xD
hehe.

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

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.

I like jquery especially for it’s easy ajax:
$(“#element”).load(“script.php”);
nice!
And Firefox has no problems with it.

HAS
you don’t know what you talkin about!

Volkan, I think you shold back that up with a explanation instead on how to do it better.

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

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?

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!

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 =)

Leave a comment

You must be logged in to post a comment.