sohnee
Senior Member

Joined: 17 Jul 2002
Posts: 1117
Location: UK
|
Posted: Tue Jan 29, 2008 6:26 am Post subject: JQuery |
 |
|
As you may have spotted on these very pages, I've been using JavaScript for a long time. More specifically, I've been using RAW JavaScript for a long time and now, it's going to stop.
Of course, this dramatisation of real life if just designed to hook you into what I'm about to say, but I've done it because what I'm about to say is really important.
There are quite a few JavaScript frameworks making their way into general use and I've spent a few weeks trying them out. What a framework does is extend, simplify and wrap something and that's exactly what I have here in front of me.
JQuery has a series of really simple commands built in that animate, manipulate and otherwise fiddle around with your page in ways that would have taken ages to write from scratch. Not only is it really simple, but it's really powerful. If used correctly, it will deprecate nicely and work in all browsers. Anyone who's implemented an opacity filter (and had to write line after line of conditions based on browser and version) will appreciate the simplicity offered by the framework.
On top of that, rather than peppering your code with event-code (onload, onmouseover, onclick, onsomethingelse!) - the support for adding events dynamically will be a breath of fresh air.
Anyway, let's look at an example:
Here are the instructions on how to fade out an object using JavaScript:
http://brainerror.net/scripts/javascript/blendtrans/
Here are the instructions to do the same using JQuery:
http://docs.jquery.com/Effects/fadeOut#speedcallback
We've instantly gone from some 30 lines of code, to 1 line of code!
Of course, it can do a whole lot more for you too; handle ajax requests, change styles, manage events and (best of all) you can add your own JavaScript into JQuery event handlers to do whatever the heck you like!
Check it out now at: http://jquery.com/
_________________
I work for: http://www.the-mag.me.uk/
Unsigned and Independent Music Magazine |
|