
Discover how jQuery simplifies web development by manipulating the DOM, selecting elements, and animating with a single line of code, while mastering events, CSS transitions, animations, and Ajax requests.
Why is it important to build a good website? What are the technologies involved?
Amongst all Javascript libraries available, jQuery stands alone. Simple, easy to use and adds so much with so little code!
A brief overview of the DOM before we dive into how jQuery works with it.
Get a web server running and set up your examples.
Explore how hello world in jquery initializes with the dollar function, the window object, and document ready, contrasting with window.onload and the dom loading sequence.
Selectors are the backbone of jQuery. How do you choose the DOM elements that you want to manipulate?
Use the element name, class name and the element id to select DOM elements.
jQuery offers a rich variety of ways by which you can choose elements to perform actions on.
Traverse the dom with jQuery, moving up, down, sideways using functions like parent, closest, siblings, next. Select elements to apply actions and highlight with red to illustrate hierarchy.
Explore advanced jQuery selectors, including even and odd, contains, contains text, and index-based rules, and learn precise element selection using child, greater-than, less-than, and non-human filters.
You can also choose to write code to select DOM elements you're interested in. This is an advanced use case though.
jQuery functions are concise precisely because they can be chained together. This example shows you the power of chaining.
This mode allows jQuery to play nice with other Javascript libraries by surrendering the $ variable to other libraries.
Learn how to access native browser elements directly from a jQuery-like collection by indexing or using square brackets, retrieving the first element, and using dot notation for actions.
Learn to set up event handlers for button clicks with jQuery, using click and on, and explore event delegation with a body listener for all buttons.
All event handlers get an event object as an input argument. This holds meta information about the context in which the event occurred and is very useful.
Demonstrate accessing the event object properties in a click handler using jQuery, logging event type, left mouse button, and the clicked link, and preventing navigation if the link is evil.
Understand how events are propagated in the browser and how jQuery abstracts away all the quirks of when to handle a event.
Discover how a single element can hold multiple event listeners for the same or different events, with three buttons showing ordered execution and the on method for multiple events.
Explore passing data to event handlers by binding properties to the event object with the on method, then access them in the handler to display random Hogwarts houses and costs.
Hook up event handlers so that they fire only for the very first occurrence of an event.
Namespaces allow us to work on events in logical groups.
Hook up events to elements which do not exist yet using event delegation.
Explore how to set up delegated events on a parent element so existing and future buttons auto-hook into handlers through event bubbling and dynamic button creation.
This is a great tool for testing your event code, trigger events without the browser event actually occurring.
A simple DOM component can choose to fire its own custom events.
Learn to create and fire custom color-change events in jQuery, then update each box’s color by triggering and listening with a namespace on boxes and their buttons.
Get introduced to the variety of animations that jQuery enables for us.
Apply the jQuery css() function to change font size with up and down buttons and to get or set multiple properties like color, background color, and font family.
Learn to use jquery's fadeIn and fadeOut to smoothly show and hide articles by fading text opacity, adjusting speeds for fast or slow transitions.
Learn to use the jQuery toggle() function with a single button to show or hide content. Explore slide, fade, and custom speed effects while understanding internal state.
Look behind the scenes at how jQuery manages to smoothly change CSS properties over the duration of the animation.
Learn to run code after a jQuery animation completes using a callback, then highlight text after the feed in, and chain actions for post-animation effects.
Explore advanced uses of the jQuery animate function by moving text with relative left and up/down changes, while adjusting opacity and applying individual easing functions for each property.
Learn to stop live animations with the stop() function, selectively halting one animation or all animations on multiple Lunacon elements using random animations and stopping in-flight animations.
You can add a delay between every animation that plays using a simple function
Learn how to chain animations in jQuery and queue actions to run in sequence, using add class, the queue method, and next to advance to the next animation.
Animations can be logically bundled together by adding them to custom queues.
Learn how to control chained animations in jQuery by bypassing the queue for select effects, using a configuration object to set duration, easing, and before/after callbacks.
Master manipulating the DOM with jQuery by selecting elements and editing their content. Add, remove, and update elements and attributes to change links and page tone.
Learn how to manipulate element contents with jQuery by updating an element with text or HTML, using input and buttons to get and set content while preserving or escaping markup.
Learn to use attr() and removeAttr() to set, get, and remove attributes on DOM elements, including id, style, and class attributes.
Remove elements from the DOM before editing them as a performance optimization
Demonstrate how jQuery's wrap() and wrapAll() wrap elements: wrap() surrounds each element with a wrapper, while wrapAll() surrounds all elements as a group, illustrated with unicorn rocks boxes.
Explore how Ajax enables asynchronous client-server communication without full page reloads, using requests and callbacks to update only changed page areas, and understand cross-origin resource sharing and restrictions.
Learn to perform server requests with the jQuery $.ajax() method against the G20 API, handle success and failure, populate a table with data, and understand the configuration object and callbacks.
Explore syntactic sugar wrappers in jQuery, such as $.get, $.getScript, and $.getJSON, that simplify ajax requests and render HTML, JSON, or script responses.
Techniques to reduce the number of times you render the DOM can greatly help improve performance.
NOTE: This course uses jQuery 3.1.0 and jQuery UI 1.12.1
jQuery takes the most common operations that you would want to perform on your website and allows you to accomplish it in one line of code. Learn jQuery by example: from basic building blocks to developing your own custom plugins!
Let's parse that.
What's included in this course: