Is Tech Right For You?

Take a few minutes to find out!

Home » Blog » Coding Languages and Tools

Tech 101: What is jQuery, and What is it Used for?

Plug in to what jQuery has to offer.

If you’re interested in started a high paying, flexible career as a web developer, then one of the first programming languages you need to learn is JavaScript (a coding language used to build dynamic web content like animated features, interactive forms, and scrolling video). But if you’re learning JavaScript (or “JS” as it’s abbreviated in tech), you also need to familiarize yourself with a JS-related tool called jQuery.

Table of Contents

  1. What is iQuery?
  2. JavaScript vs. jQuery—What’s the Difference?
  3. jQuery Plugins
  4. How to Learn More About JavaScript and jQuery
woman in glasses with hand on face, thinking

Is Tech Right For you? Take Our 3-Minute Quiz!

You Will Learn: If a career in tech is right for you What tech careers fit your strengths What skills you need to reach your goals

Take The Quiz!

What is jQuery?

jQuery—A Definition:

Simply put jQuery is a collection of pre-written JavaScript code (known as a JavaScript library) that you can add to your own coding projects.

If you’re new to coding, this might sound like cheating. Shouldn’t you be writing your own code? The reality is—for certain routine coding tasks—there’s absolutely no point in reinventing the wheel. You probably wouldn’t manufacture your own wood when building a house, and coding is no different. jQuery allows web developers to plug routine JavaScript features into a web page so they can spend more time focusing on complicated features that are unique to their site.

Why Use jQuery?

In addition to understanding WHAT jQuery is, it’s helpful to understand WHY developers use it. We’ll delve deeper into some of these points below, but here’s a list to provide the TLDR:

  • jQuery makes JavaScript programming faster and more efficient
  • jQuery is open source (meaning anyone can contribute to or modify it) and has a large user community, meaning it is consistently supported and added-on to.
  • jQuery has extensive documentation (including in-line code examples!)
  • jQuery plays well with any other JavaScript libraries you might be using
  • jQuery has a TON of plug-ins that let you extend jQuery’s functionality as needed

(back to top)

 

An example of an accordion-style dropdown menu built with jQuery

What is the Main Difference Between JavaScript and jQuery?

JavaScript and jQuery are mentioned so interchangeably, it can be confusing to separate the two. Just remember: JavaScript is a standalone programming language, while jQuery is a collection of JavaScript code (not its own language).

For a quick visual of the difference (and to illustrate exactly what jQuery is used for), consider the following. Let’s say you want users to receive a “thanks for signing up” confirmation message when they add themselves to your website’s email list. Hand coding that function using JavaScript would look something like this:

window.onload = initAll;
function initAll() {
document.getElementById(“submit”).onclick = submitMessage;
}
function submitMessage() {
var greeting = document.getElementById(“name”).getAttribute(“value”);
document.getElementById(“headline”).innerHTML = “Thank you for joining our email list,” + greeting;
return false;
}

That’s a lot of code for such a basic function. However, by using jQuery code snippets you’ll end up simplifying it into something along the lines of this jQuery example:

$(“#submit”).click(function () {
var greeting = $(“#name”).val();
$(“#headline”).html(“Thank you for joining our email list, ” + greeting);
return false;
});

This much more manageable jQuery script sends a request to the jQuery library, which you can either install on your own website or use via Google by including a jQuery link to Google’s hosted libraries in your code:

<head>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js”></script>
</head>

jQuery then responds to your request and performs the requested function for your user. Either approach (JavaScript or jQuery) will produce a “thank you” message, but a jQuery script will get you there a lot faster and more efficiently. Further, you’ll be able to reuse this jQuery function whenever the same need arises in this or any other web development projects you work on.

(back to top)

 

An example of a tabs menu built with jQuery

woman in glasses with hand on face, thinking

Is Tech Right For you? Take Our 3-Minute Quiz!

You Will Learn: If a career in tech is right for you What tech careers fit your strengths What skills you need to reach your goals

Take The Quiz!

jQuery Plugins

As useful as jQuery is for simplifying individual functions (like the one above), it can be extended out even more powerfully in the form of plugins—collections of JS code from the jQuery library that chain together those individual functions and create robust website features and tools (again, without coding them from the ground up).

Plugins are created by jQuery users based on code in the jQuery library, and can then be shared publicly online. While plugins can be found in many places, those found on the official jQuery UI (User Interface) repository can safely be considered quality work, since they’re curated by jQuery’s professional community. In order to give a closer look at what else jQuery can be used for, here are ten jQuery plugins available from the jQuery site.

1. Effect

Effect is a simple jQuery plugin that allows you to assign a number of animation effects to an element on a web page. Pressing the assigned button with the desired effect selected will cause the page element to behave in different ways—bounce, disappear in a folding pattern, slide, fade out, etc.

2. taggingJS

Ever added a categorizing “tag” to a blog post? Chances are, that feature was made possible with JavaScript code. This taggingJS jQuery script pulls from a JavaScript library and allows you to add a tagging system to your website—a text bar where you can add relevant subject topics to a post, and help boost your indexability and ranking with search engines like Google.

3. Autocomplete

You know how the search bar on big time websites like Google.com has an autocomplete feature that starts offering suggestions to finish what you’re typing? You can add one of those JavaScript beauties to your own project with this Autocomplete jQuery plugin. This particular example is coded to offer autocomplete suggestions for programming terms, but you can add your own list of autocomplete terms into the plugin.

4. ScrollMagic

The ScrollMagic plugin uses jQuery code to animate web page elements based on the positioning of a user’s scroll bar (the bar on the right side of your browser window that lets you move up and down the page). You can either cause an animation to happen as the page scrolls, or synchronize animation with the scroll position (like the jaunty top hat on the plugin demo page that magically transforms into the ScrollMagic logo as you scroll down, or reverts back into a hat as you scroll up).

5. Fine Uploader

Ever used one of those menus online to upload an image where you can either drag the image into a box or click on a button to select the image file from your computer? That’s another everyday example of what JavaScript—and by extension, jQuery—is used for. The Fine Uploader plugin allows web developers to skip the steps of building a new uploader and uses jQuery tools to drop a prebuilt one directly on your web page.

6. blueimp Gallery

blueimp Gallery is a responsive (meaning it adjusts to display on desktop and mobile screens) image gallery that can be controlled by a desktop keyboard and mouse or by swiping on a phone or tablet. This plugin can be set to display either images or videos in a carousel format, and can also display images in a lightbox mode.

7. Slick

Slick is another responsive image carousel plugin with different display options than the blueimp Gallery above. Slick allows for things like singular or multiple display formats, variable width displays, “lazy loading” (where the next image on the carousel fades into view as you scroll rather than displaying statically), and a single image fade in/out display option.

8. Slider

Another ubiquitous web page feature brought to you by JavaScript are the sliders used to adjust volume and other levels on a web page. This Slider plugin uses the jQuery library to assign numerical values on a horizontal bar. The slider can then be moved up and down the bar using a mouse or keyboard arrow keys.

9. Infinite AJAX Scroll

One of the JavaScript related functions that jQuery code can simply for web developers are something called AJAX calls. While we’ve written about what exactly AJAX is elsewhere, in a nutshell it has to do with pulling content from a server and loading it on a web page so that things on a page can change without a user reloading the page themselves. This Infinite AJAX Scroll plugin uses AJAX so that additional content can appear on a page as a user scrolls down (rather than having all the content loaded statically on the page). You’ll notice this effect on blogs or other sites with a lot of written content where you don’t have to click a “more” button to continue reading—the text simply loads as you scroll.

10. AnimateScroll

This AnimateScroll plugin jazzes up standard header menus by animating each menu panel as a user scrolls past it with their mouse. As the mouse drags over, the individuals menu elements animates and pops out from its peers.

(back to top)

Ready to Learn More About JavaScript and jQuery?

The big takeaway from all these ways to use jQuery? jQuery is a powerful tool that will make your JavaScript skills infinitely more effective than if you were coding each and every one of these features from scratch.

jQuery also speaks to the communal nature of coding—all of these plugins are the efforts of individual web developers finding ways to maximize gains out of JavaScript and jQuery and sharing those results with the programming community. As your skills improve, you can (and should) continue to use these tools, and you’ll also have your own opportunities to give back and contribute your own discoveries.

If you’re ready to take on all that jQuery has to offer, you can check out the official jQuery community learning center for some beginning jQuery tutorial tips and tricks, and—when you’re ready to get even more serious about JavaScript and jQuery — you can consider trying paid, instructor led courses like Skillcrush Break into Tech, which includes a unit on both topics.

(back to top)

woman in glasses with hand on face, thinking

Is Tech Right For you? Take Our 3-Minute Quiz!

You Will Learn: If a career in tech is right for you What tech careers fit your strengths What skills you need to reach your goals

Take The Quiz!

Author Image

Scott Morris

Scott Morris is Skillcrush's staff writer and content producer. Like all the members of Skillcrush's team, he works remotely (in his case from Napa, CA). He believes that content that's worth reading (and that your audience can find!) creates brands that people follow. He's experienced writing on topics including jobs and technology, digital marketing, career pivots, gender equity, parenting, and popular culture. Before starting his career as a writer and content marketer, he spent 10 years as a full-time parent to his daughters Veronica and Athena.
(Back to Top.)

Category: Blog, Coding Languages and Tools, Entry Level Tech Jobs, Front End Developer, Full Stack Developer, Learn to Code

Related Articles

  • Tech 101: What's the Difference Between Java and JavaScript?
  • Tech 101: What is JavaScript?
  • Tech 101: What Is a JavaScript Framework? Here’s Everything You Need to Know
  • Tech 101: QA (Quality Assurance)

两个鬼故事起名开餐饮店林徽因太原区号男宝宝楚辞起名大师起姓名个体户经营起名免费h网站免费起名字男孩2020免费起名带木火的男名字大全集网游之神王法则黄宗羲100分王姓男孩起名大全win7摄像头公司取名起名大全检测面貌一新黄氏起名男童电脑怎么看电视直播drivergenius.com知网免费入口继字起名男孩名字起的四个字名字合作社起名字啊公司起名 3个字僵尸电影姓赵男人起名大全穿书自救指南动漫免费观看全集起名古诗词男孩名公司起名查厉害重庆车友会起企业名称打分少年生前被连续抽血16次?多部门介入两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”淀粉肠小王子日销售额涨超10倍高中生被打伤下体休学 邯郸通报单亲妈妈陷入热恋 14岁儿子报警何赛飞追着代拍打雅江山火三名扑火人员牺牲系谣言张家界的山上“长”满了韩国人?男孩8年未见母亲被告知被遗忘中国拥有亿元资产的家庭达13.3万户19岁小伙救下5人后溺亡 多方发声315晚会后胖东来又人满为患了张立群任西安交通大学校长“重生之我在北大当嫡校长”男子被猫抓伤后确诊“猫抓病”测试车高速逃费 小米:已补缴周杰伦一审败诉网易网友洛杉矶偶遇贾玲今日春分倪萍分享减重40斤方法七年后宇文玥被薅头发捞上岸许家印被限制高消费萧美琴窜访捷克 外交部回应联合利华开始重组专访95后高颜值猪保姆胖东来员工每周单休无小长假男子被流浪猫绊倒 投喂者赔24万小米汽车超级工厂正式揭幕黑马情侣提车了西双版纳热带植物园回应蜉蝣大爆发当地回应沈阳致3死车祸车主疑毒驾恒大被罚41.75亿到底怎么缴妈妈回应孩子在校撞护栏坠楼外国人感慨凌晨的中国很安全杨倩无缘巴黎奥运校方回应护栏损坏小学生课间坠楼房客欠租失踪 房东直发愁专家建议不必谈骨泥色变王树国卸任西安交大校长 师生送别手机成瘾是影响睡眠质量重要因素国产伟哥去年销售近13亿阿根廷将发行1万与2万面值的纸币兔狲“狲大娘”因病死亡遭遇山火的松茸之乡“开封王婆”爆火:促成四五十对奥巴马现身唐宁街 黑色着装引猜测考生莫言也上北大硕士复试名单了德国打算提及普京时仅用姓名天水麻辣烫把捣辣椒大爷累坏了

两个鬼故事 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化