Category: Introduction
-
Conclusion
We’ve covered a great deal of material in this whirlwind introduction to jQuery. To summarize, it’s generally useful for any page that needs to perform anything but the most trivial of JavaScript operations. It’s also strongly focused on enabling page authors to employ the concept of unobtrusive JavaScript within their pages. With this approach, behavior…
-
jQuery fundamentals
At its core, jQuery focuses on retrieving elements from HTML pages and performing operations on them. If you’re familiar with CSS, you’re already well aware of the power of selectors, which describe groups of elements by their type, attributes, placement within the document, and much more. With jQuery, you can employ that knowledge and that…
-
How jQuery is structured
The jQuery repository, hosted on GitHub, is a perfect example of how front-end development has changed over the past years. Although not strictly related to the use of the library itself, it’s always important to know how expert developers organize their workflow and the tools they employ. If you’re an experienced front-end developer, chances are…
-
Installing jQuery
Now that you know what jQuery is and what it can do for you, you need to download the library to start getting your hands dirty. Once there, you’ll probably be overwhelmed by the plethora of options available. Branch 1.x, 2.x, or 3.x? Compressed or uncompressed? Download it or use a content delivery network (CDN)?…
-
Separating behavior from structure
For all the same reasons that it’s desirable to segregate style from structure within an HTML document, it’s just as beneficial (if not more so) to separate the behavior from the structure. Ideally, an HTML page should be structured as shown in figure 1.2, with structure, style, and behavior each partitioned nicely in its own niche. Figure 1.2. With…
-
Write less, do more
jQuery’s motto is “Write less, do more.” If you’ve spent any time at all trying to add dynamic functionality to your pages, you’ve found that performing simple tasks using raw JavaScript can result in dozens of lines of code (LoC). The creator of jQuery specifically created this library to make common tasks trivial and easy…
-
Introducing jQuery
This lesson covers “There are only two kinds of languages: the ones people complain about and the ones nobody uses.” How well this sentence from Bjarne Stroustrup, who designed and implemented C++, summarizes the sentiments about JavaScript. It, as well as several other languages (most notably PHP), was bemoaned as a “bad” language for several…