Making The Web Interactive: An Introduction To jQuery

featured jquery   Making The Web Interactive: An Introduction To jQueryjQuery is a client-side scripting library that nearly every modern website uses – it makes websites interactive. It’s not the only Javascript library, but it is the most developed, most supported, and most widely used. It’s one of the building blocks of any modern website. But what exactly is jQuery, what makes it so popular, and why should you care about it if you’re starting out as a web developer?

What Is jQuery?

jQuery is an extension of Javascript, a library of Javascript functions and utilities that add visual flair, and make advanced features simple to implement in just a few lines of code. It is supported across browsers, and open source. Plus you can also extend jQuery functionality with easy to use plugins.

billboard example   Making The Web Interactive: An Introduction To jQuery

jQuery is built on top of Javascript, but it adds methods and functionality not found in pure Javascript. It was created in order to simplify Javascript usage and remove the hassles concerned with different Javascript implementation in different browsers. With jQuery you can just write once, and jQuery will interpret your code correctly for any browser.

The main function of jQuery is for DOM manipulation (DOM is the Document Object Model), and it means the underlying structure of any webpage you visit. Every single thing you see on the page – and many you don’t see – are represented in the DOM.

jQuery is not the only Javascript library out there, but it is the most popular – about 55% of the top 10,000 websites use it. Prototype, MooTools and Scriptaculous are popular alternatives, but not nearly as well supported.

Client Side vs Server Side

Most webpages are generated on the server side – MakeUseOf uses PHP and MySQL (in the form of WordPress) to fetch the article data from a database and then apply a template to that data. The resulting page is sent to your browser, interpreted, and displayed to you. Clicking on a link makes another request to the database, and yet another page is generated. But what if you want to create some kind of interactivity on the page? A form that checks what the user types (like Twitter, which counts how many letters you have left), a button which brings up a dialog box, or perhaps you want to load some more data without reloading the entire page?

This is where client-side scripting comes into play. That’s where the client – your browser – does the heavy lifting. Most websites, this one included, use a little of both.

pistolslut   Making The Web Interactive: An Introduction To jQuery

Why Use jQuery?

Visual Flair

jQuery let’s you change parts of the webpage in response to user actions. As a quick example, click this link – every link on the page will change to red. Useless? Perhaps, but you get the point. Image slideshows are a common use of jQuery. Balancing pointless visual effects and genuinely useful additions to the user experience is part of the skill in being a web developer.

Here’s a quick list of some really awesome effects you can achieve.

jquery xhcharts   Making The Web Interactive: An Introduction To jQuery

Easy Events

Nearly all software works on an event model – click on something, and a click event is triggered. Drag your finger across a tablet, and a drag event is triggered. Applications “listen” for these events and do something – jQuery lets you do this in a browser.

Perform AJAX Simply

Asynchronous Javascript And XML is a way of communicating to a remote server without having to load another page. A good example of this is the Facebook status stream. Try to scroll through all your updates until you get to the bottom. You can’t. As soon as you get to the end, jQuery detects you’re close, and sends an AJAX request for more statuses to display.

It then injects them into the current page, without you realizing. You get an infinite stream of updates, but they’re not all loaded at the start.

Advanced User Interfaces

Along with the jQuery UI core plugin, you can build complete web applications using standard form components; progress bars, sliders, buttons, tabs, drag and drop – it’s all there. A simple theming system lets you customize the look and feel, or you can use one of the defaults.

jquery uiu   Making The Web Interactive: An Introduction To jQuery

Should I Care?

If you have any interest at all in developing websites, then yes – jQuery is a thing you definitely need to learn. If you’ve ever asked yourself “How can I make X do Y when the user does Z?”, then you’re going to love jQuery. Adding it to your site is as simple as adding a link to it in the header; or telling WordPress to load it.

Would you like to learn jQuery? Let us know in the comments and I’ll see what I can do.

Image Credits: Dynamic Rotating Billboard Created Using jQuery, PistolSlut.com, Chart Made With jQuery

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

17 Comments -

5 votes

Martin

I would certainly love to learn jQuery. Up until now it’s seemed something too difficult, but you make it sound so easy I’d be really keen to learn it. I make websites but only using basic knowledge. I think this would be a very nice ‘next-step’ to increase my web development abilities. Thanks for the offer, I look forward to what you can do for me/us.

10 votes

Alex Downs

I had no idea that jQuery was so fundementaly essential for the web designing process and would love to learn how to utilize it. Personally, I like the idea of MakeUseOf highlighting more programming tutorialsinstead of just recommending various sites to learn.

2 votes

salim benhouhou

check out Jeffery Way’s course ” 30 Days to Learn jQuery ” it’s great and it’s free at :

https://tutsplus.com/course/30-days-to-learn-jquery/

0 votes

Scott Macmillan

I hadn’t realized the importance of iQuery.Thank you for the informative article.

0 votes

Bassey

I’d certainly enjoy a piece on learning JQuery.

0 votes

Francisco de Gusmão

I’ve used it on a work, it provides great features! It’s easy to work with, I recommend to everyone!

1 votes

Robert

I have found using Jquery to be relatively easy to learn. They’ve good documentation on the jquery.com web site. there is also the api.jquery.com and ui.jquery.com
If you are developing a business web-site, it is definitely something you need in your tool box.
Another good source of web training that I have used over the years is:
http://www.w3schools.com/
They have a short course on JQuery to give you some of the basics.

0 votes

isaacson

great article. More jquery pls!

0 votes

Jai

Yes. Waiting for a detailed lession on jquery

0 votes

Tom Bogan

Would love to learn jQuery. Sounds very interesting.

0 votes

Keith Swartz

I loved the article! Very well researched, constructed & written in an understandable way. Thank you James Bruce & keep him straight Justin!

0 votes

Nevzat Akkaya

JQuery’s own documentation is also a great resource. Thanks for a little programming love, MUO :)

0 votes

Rigoberto Garcia

Great article James, thanks…

0 votes

Angeline Factor

wow, I wanna get into jQuery! but I guess I need to focus first on basic javascript before this…

2 votes

James Bruce

Not really; jQuery is really easy to learn without Javascript – I still can’t understand a lot of pure Javascript. The basic of JS can be picked up as when needed, but easy to get started without it. that’s the beauty of jQuery!

0 votes

Ronald

I’m looking forward to downloading some of your high tech material, Thank

0 votes

Hisham Sliman

YOU MAKE IT LOOK WAAAAY EASY :)
THANK YOU