
This video gives overview of the entire course.
In this video, we are going to learn about jQuery's core features and strategies.
In this video we are going to take a brief look at some changes and how they're likely to impact an existing jQuery project.
In this video, we are going to examine how to put the library into action.
In this video, we are going to use developer tools to understand what is happening on our pages.
The DOM serves as the interface between JavaScript and a web page; it provides a representation of the source HTML as a network of objects.
This video teaches us how jQuery works with CSS selectors.
Selectors in jQuery have a spectrum of specificity, from very general selectors, too much targeted selectors. We will look at an example that increases the size of the first letter for top-level <li> text.
Attribute selectors are a particularly helpful subset of CSS selectors. They allow us to specify an element by one of its HTML attributes.
Custom selectors enhance the capabilities of CSS selectors to locate page elements in new ways.
There are many occasions when selecting a parent or ancestor element is essential; that is where jQuery's DOM traversal methods come into play.
We need to explicitly iterate over jQuery objects, especially when the same result is possible by using implicit iteration in jQuery functions.
We have already seen how to make jQuery react to the loading of a web page, but there's bit more to be said about it.
The traditional mechanism for registering event handlers through JavaScript is to assign a function to the DOM element's corresponding property
In illustrating the ability of the click event to operate on normally non-clickable page elements, we have crafted an interface that doesn't indicate that the style switcher label. To remedy this, we can give it a rollover state, making it clear that it interacts in some way with the mouse
To show a case in which .hover() does not help our cause, we'll alter the collapsing behavior
There are times when we will be done with an event handler we previously registered. It is possible to handle this situation with conditional statements inside our event handlers, but it is more elegant to unbind the handler entirely.
At times, it is convenient to execute code that we have bound to an event, even if the event isn't triggered directly by user input.
There may be times when we need to apply styles that haven't been or can't easily be defined in a stylesheet. Fortunately, jQuery offers the .css() method for such occasions.
The basic .hide() and .show() methods, without any parameters, can be thought of as smart shorthand methods for .css('display', 'string').
In this video, we will include a speed in our example when showing the second paragraph of Abraham Lincoln's Gettysburg Address.
In addition to the prebuilt effect methods, jQuery provides a powerful .animate() method that allows us to create our own custom animations with fine-grained control
There may be times, however, when we want to queue our effects to have them occur one after the other.
The methods are particularly helpful in that they avoid adding a class if it already exists on an element, and correctly handle cases where multiple classes are applied to a single element
To actually manipulate the DOM tree, you'll need to learn a bit more about the function that lies at the very heart of the jQuery library.
Whenever elements can be copied to enhance a page visually, we can let jQuery do the heavy lifting.
It would be nice to be able to modify the pull quote a bit by dropping some words and replacing them with ellipses to keep the content brief
Ajax is just a means of loading data from the server into the web browser without a page refresh. This data can take many forms, and we have many options for what to do with it when it arrives.
The server can dynamically shape the data based on input from the browser. We're helped along by jQuery in this task
At times, though, it is handy to know a bit more about the HTTP request as it progresses. If such a need arises, jQuery offers a suite of functions that can be used to register callbacks when various Ajax-related events occur.
Responsible developers, however, should account for the possibility of network or data errors and report them appropriately.
Suppose we wanted to allow each dictionary term name to control the display of the definition that follows; clicking on the term name would show or hide the associated definition.
jQuery deferred objects were introduced at a time when there was no consistent way to handle asynchronous behavior in JavaScript code. Promises help us orchestrate asynchronous stuff, such as multiple HTTP requests, file reads, animations, and so on.
This video gives an overview of the entire course.
We can easily demonstrate these tasks using the jQuery Cycle plugin.
Plugins need not be limited to providing additional jQuery methods. They can extend the library in many ways and even alter the functionality of existing features.
While the jQuery UI code may often be packaged as a single file, it is actually a comprehensive suite of related plugins.
To create a website or application for modern day smart phones and tablets, we can turn to the jQuery Mobile project.
Some of the built-in capabilities of jQuery are provided via what we have been calling global functions.
Most of jQuery's built-in functionality is provided through its object instance methods, and this is where plugins shine as well.
We'll replicate a feature of CSS by using a more brute-force JavaScript approach-- an approach that is more suitable for demonstration than for production code.
These widgets present a consistent API to JavaScript programmers. This consistency makes learning to use one easy.
We'll build an HTML document consisting of a list of news items. We'll place those items in a table so that we can experiment with selecting rows and columns in multiple ways.
There is much to learn about performing our element-finding tasks efficiently. This efficiency can work as both code that is easier to write and read, and code that executes more quickly inside the web browser.
To be able to get the most out of .end() and .addBack(), and in general to write efficient jQuery code, we need to understand a little more about how the DOM traversal methods work.
For our sample document, we will create a simple photo gallery. The gallery will display set of photos with an option to display additional photos upon the click of a link.
The event target represents the innermost, or most deeply nested, element that receives the event.
Custom events must be triggered manually by our code. In the sense, they are like regular functions that we define, in that we can cause a block of code to be executed when we invoke it from another place in the script.
Several native events have the potential for frequent triggering. Common culprits include scroll, resize, and mousemove. To account for this, we will implement event throttling
To implement special behavior for an event, we add a property to the $ .event.special object.
To refresh our memory about jQuery's effect methods, we'll set up a baseline from which we build in this section, starting with a simple hover animation.
There are many cases in which this animation queue, known within jQuery as fx, causes desirable behavior. In the case of hover actions such as ours, it needs to be avoided.
Some of the object's properties are undocumented and intended to use solely within the library itself. In this video, we will take a look at a few of the documented properties.
We can subtly alter the effect by changing the easing equation to easeInQuart for the top property alone, causing the element to follow a curved path rather than a straight one.
At times, we come across situations in which we want to act when a process completes, but we don't necessarily know how long the process will take, or even if it will be successful. To handle these cases, jQuery offers deferred objects
Even though we've looked at a number of advanced features, jQuery's Effects Module has much more to offer.
Sorting rows of table is a common task and is an efficient way to assist users in quickly finding the information they need. Obviously, there are, a number of ways to do this.
We will use the jQuery DOM manipulation methods to insert new elements and move other existing elements to new positions within the DOM. We will start with the most straightforward piece of the puzzle – linking the table headers.
The solution for slow comparator is to pre-compute the keys for comparison. We can do most of the expensive work in an initial loop and store the result with jQuery's .data().
We've managed to sort the rows correctly by manipulating the content, we can make our code more efficient by outputting more HTML from the server in the form of HTML5 data attributes
More often than not, web applications rely on JavaScript to deliver content as well as manipulate it once it arrives. In our third table sorting example, we'll do the same.
The simple methods, though, do quite a bit of work for us behind the scenes. We can get even more utility out of them if we better understand what they do.
We encountered the concept of progressive enhancement. To reiterate, this philosophy ensures a positive user experience for all users by mandating that, a working product be put in place first before additional embellishments are added for users with modern browsers.
Introducing any kind of network interaction into an application brings along some degree of uncertainty. Because of these reliability concerns, we should always plan for the worst case and prepare for error scenarios.
When an Ajax request is made, jQuery determines the best mechanism available for retrieving the data. This transport could be the standard XMLHttpRequest object, Microsoft ActiveX XMLHTTP object, or a <script>.
A common feature of searches is to display a dynamic list of results as the user is typing. We can emulate this "live search" feature for our jQuery API search by binding a handler to the keyup event
The jQuery Ajax framework is powerful, as we've seen, but even so there are times when we might want to change the way it behaves. Unsurprisingly, it offers multiple hooks that can be used by plugins to give the framework brand new capabilities.
jQuery 3 enables you to create web pages with brilliant animation effects that will make your web application seem flawless. It helps avoid complex JavaScript code with its new and inbuilt features. So, if you’re a web developer who wants to create web applications that look good, are efficient, have rich user interfaces, and integrate seamlessly with any backend using AJAX, then go for this Learning Path.
Packt’s Video Learning Path is a series of individual video products put together in a logical and stepwise manner such that each video builds on the skills learned in the video before it.
The highlights of this Learning Path are:
● Explore all the latest features of jQuery 3.0 to reflect modern JavaScript environments
● Learn selectors, events, and animation functions to create the best user interface for your web applications
Let's take a quick look at your learning journey. This Learning Path starts off by explaining the new features of jQuery 3 and building a jQuery-powered web page. You will then learn jQuery 3 selectors and working with DOM traversal methods. You will also explore event handling, styling, animations, and creating optimized user interfaces. Next, you’ll learn DOM manipulation and sending data via AJAX. You will also learn how to build and use third-party jQuery plugins. Finally, you will learn advanced features of jQuery 3 such as advanced selectors and traversing elements, advanced events and effects, and implementing progressive enhancement with AJAX.
By the end of this Learning Path, you will leverage all the new features of jQuery 3 effectively to create your own fully featured web applications.
Meet Your Expert: We have the best works of the following esteemed authors to ensure that your learning journey is smooth:
Adam Boduch has been involved with large-scale JavaScript development for nearly 10 years. Before moving to the front end, he worked on several large-scale cloud computing products, using Python and Linux. No stranger to complexity, Adam has practical experience with real-world software systems and the scaling challenges they pose. He is the author of several JavaScript books, including React and React Native by Packt Publishing, and is passionate about innovative user experiences and high performance.
Jonathan Chaffer is a member of Rapid Development Group, a web development firm located in Grand Rapids, Michigan. His work there includes overseeing and implementing projects in a wide variety of technologies, with an emphasis on PHP, MySQL, and JavaScript. In the open source community, he has been very active in the Drupal CMS project, which has adopted jQuery as its JavaScript framework of choice. He is the creator of the Content Construction Kit, now a part of the Drupal core used to manage structured content. He is also responsible for major overhauls of Drupal's menu system and developer API reference.
Karl Swedberg is a web developer at Fusionary Media in Grand Rapids, Michigan, where he spends much of his time writing both client-side and server-side JavaScript code. When he isn't coding, he likes to hang out with his family, roast coffee in his garage, and exercise at the local gym.