Visual Quick Start Guide jQuery and jQuery UI
- All code is at http://www.jayblanchard.net/ stopped at xii
- Visual Quick Start Guide, jQuery and jQuery UI link to ~59 pages on assignment page.
Introduction…
- jQuery developed in 2005 library that gives you a jQuery object, making it easy to design web pages
-
jQuery UI 2007, User Interface Components not RWD “bootstrap/foundation?”
- Heart of jQuery is sizzle – CSS selector engine.
$jQuery( sizzle selector ).method
Variable is a name “identifier” value pair. jsBin Variable review
Variables have scoped, they existed in block defined in
function versus method, a function inside a class is a method
document.write write is a method
Learning the Basics
- CDN Content Delivery Network
- Load a specific version of jQuery using CDN Google, Microsoft, jQuery
- Very fast nearby replicated servers
- Specific version is cached locally by browser
- Disadvantage: Relying on external site - e.g., china is blocking Google
- Can host it locally, you have full control (will cache your pages)
Downloading jQuery
- can use jquery.com
- Makes off line local development easier, DW often automatically installs local copy
- Go to site, download and save file to your local site root
Using jQuery CDN
- For your site always use the exact same version throughout
- Make sure script tag is identical, future find/replace
- For cimw160 we are using https://code.jquery.com/jquery-3.6.0.min.js
Minify "zip" code
- Minify code remove white spaces, comments
- Improves download performance
- Home page Google closure Compiler
- Closer IDE can paste code
- All browsers also support libz, so you can zip your library - 7zip
Click me
With jQuery, we use the jQuery object to select an element, then we chain a method and add a callback function
jsBin example
Rewind and Review
- Where do you get the query library?
- Is it better to host jQuery or use a CDN?
- What is jQuery?
Back to assignment J2.