Book description
Want to add more interactivity and polish to your websites? Discover how jQuery can help you build complex scripting functionality in just a few lines of code. With Head First jQuery, you'll quickly get up to speed on this amazing JavaScript library by learning how to navigate HTML documents while handling events, effects, callbacks, and animations. By the time you've completed the book, you'll be incorporating Ajax apps, working seamlessly with HTML and CSS, and handling data with PHP, MySQL and JSON.
If you want to learn—and understand—how to create interactive web pages, unobtrusive script, and cool animations that don't kill your browser, this book is for you.
- Use jQuery with DOM to overcome the limitations of HTML and CSS
- Learn how jQuery selectors and actions work together
- Write functions and wire them to interface elements
- Use jQuery effects to create actions on the page
- Make your pages come alive with animation
- Build interactive web pages with jQuery and Ajax
- Build forms in web applications
Table of contents
- Dedication
- A Note Regarding Supplemental Files
- Advance Praise for Head First jQuery
- Praise for other Head First books
-
How to use this book: Intro
- Who is this book for?
- We know what you’re thinking
- And we know what your brain is thinking
- Metacognition: thinking about thinking
- Here’s what WE did
- Here’s what YOU can do to bend your brain into submission
- Read me
- Software requirements
- Download jQuery
- Folder setup
- The technical review team
- Acknowledgments
- Safari® Books Online
-
1. Getting Started with jQuery: Web Page Action
- You want web page power
- HTML and CSS are fine, but...
- ...you need the power of script
- Enter jQuery (and JavaScript)!
- Look into the browser
- The hidden structure of a web page
- jQuery makes the DOM less scary
- How does that work?
- jQuery selects elements the same way CSS does
- Style, meet script
- jQuery selectors at your service
- jQuery in translation
- Your first jQuery gig
- Set up your HTML and CSS files
- Slide on in...
- May the fade be with you
- That’s it?
- You rescued the Furry Friends campaign
- Your jQuery Toolbox
-
2. Selectors and Methods: Grab and Go
- Jump for Joy needs your help
- What are the project requirements?
- Dig in with divs
- A click event up close
- Add the click method to your page
- Get more specific
- Classing up your elements
- ID-entifying elements
- Wire up your web page
- Meanwhile, back to our list
- Creating some storage space
- Mix things up with concatenation
- Meanwhile, back in the code...
- Insert your message with append
- Everything works great, but...
- Give me $(this) one
- Put $ (this) to work
- Good riddance with remove
- Dig down with descendant selectors
- Your turn to jump for joy
- Your jQuery Toolbox
-
3. jQuery Events and Functions: Making Things Happen on Your Page
- Your jQuery skillz are in demand again
- The money man has a point...
- Making your page eventful
- Behind the scenes of an event listener
- Binding an event
- Triggering events
- Removing an event
- Going through the motions elements
- Your project structure
- Making things function-al
- The nuts and bolts of a function
- The anonymous function
- Named functions as event handlers
- Passing a variable to a function
- Functions can return a value, too
- Use conditional logic to make decisions
- Jump for Joy needs even more help
- Methods can change the CSS
- Add a hover event
- You’re almost there...
- Your jQuery Toolbox
-
4. jQuery Web Page Manipulation: Mod the DOM
- The Webville Eatery wants an interactive menu
- Go vegetarian
- Class up your elements
- Button things up
- What’s next?
- Swinging through the DOM tree
- Traversal methods climb the DOM
- Chain methods to climb farther
- Variables can store elements, too
- There’s that dollar sign again...
- Expand your storage options with arrays
- Store elements in an array
- Change out elements with replaceWith
- How can replaceWith help?
- Think ahead before using replaceWith
- replaceWith doesn’t work for every situation
- Insert HTML content into the DOM
- Use filter methods to narrow your selections (Part 1)
- Use filter methods to narrow your selections (Part 2)
- Bring the burger back
- Where’s the beef (er...meat)?
- A meaty array
- The each method loops through arrays
- That’s it...right?
- Your jQuery Toolbox
-
5. jQuery Effects and Animation: A Little Glide in Your Stride
- DoodleStuff needs a web app
- Do the Monster Mashup
- Monster Mashup needs layout and positioning
- A little more structure and style
- Make the interface click
- Make the lightning effect
- How does jQuery animate elements?
- Fade effects animate the CSS opacity property
- Sliding is all about height
- Put fade effects to work
- Combine effects with method chains
- Striking back with a timed function
- Add the lightning functions to your script
- DIY effects with animate
- What can and can’t be animated
- animate changes style over time
- From where to where exactly?
- Absolute vs. relative element movement
- Move stuff relatively with operator combinations
- Add the animate functions to your script
- Look, Ma, no Flash!
- Your jQuery Toolbox
-
6. jQuery and JavaScript: Luke jQuery, I Am Your Father!
- Spicing up the Head First Lounge
- Objects offer even smarter storage
- Build your own objects
- Create reusable objects with object constructors
- Interacting with objects
- Set up the page
- The return of arrays
- Accessing arrays
- Add and update items in arrays
- Perform an action over (and over, and over...)
- Looking for the needle in a haystack
- Decision making time...again!
- Comparison and logical operators
- Clearing things up with jQuery...
- Add some extra excitement
- Your jQuery/JavaScript Toolbox
-
7. Custom Functions for Custom Effects: What Have You Done for Me Lately?
- A storm is brewing
- We’ve created a monster...function
- Get control of timed effects with the window object
- Respond to browser events with onblur and onfocus
- Timer methods tell your functions when to run
- Write the stopLightning and goLightning functions
- Feature request for Monster Mashup
- Let’s get (more) random
- You already know the current position...
- ...and the getRandom function too
- Move relative to the current position
- Monster Mashup v2 is a hit!
- Your jQuery Toolbox
-
8. jQuery and Ajax: Please Pass the Data
- Bring the Bit to Byte race into this century
- Looking at last year’s page
- Getting dynamic
- OLD web, meet the NEW web
- Understanding Ajax
- The X factor
- GETting data with the ajax method
- Parsing XML data
- Scheduling events on a page
- Self-referencing functions
- Getting more from your server
- What time is it?
- Turning off scheduled events on your page
- Your jQuery/Ajax Toolbox
-
9. Handling JSON Data: Client, Meet Server
- Webville MegaCorp’s Marketing Department doesn’t know XML
- XML errors break the page
- Collect data from a web page
- What to do with the data
- Format the data before you send it
- Send the data to the server
- Store your data in a MySQL database
- Create your database to store runner info
- Anatomy of an insert statement
- Use PHP to access the data
- Handle POST data on the server
- Connect to a database with PHP
- Use select to read data from a database
- Get data with PHP
- JSON to the rescue!
- jQuery + JSON = Awesome
- A few PHP rules...
- A few (more) PHP rules...
- Format the output using PHP
- Access data in the JSON object
- Data sanitization and validation in PHP
- Your jQuery/Ajax/PHP/MySQL Toolbox
-
10. jQuery UI: Extreme Form Makeover
- Cryptozoologists.org needs a makeover
- Pimp your HTML form
- Save coding headaches (and time) with jQuery UI
- What’s inside the jQuery UI package
- Build a date picker into the sightings form
- jQuery UI behind the scenes
- Widgets have customizable options
- Styling up your buttons
- Control numerical entries with a slider
- Computers mix color using red, green, and blue
- Build the refreshSwatch function
- One last little thing...
- Your jQuery Toolbox
-
11. jQuery and APIs: Objects, Objects Everywhere
- Where’s Waldo Sasquatch?
- The Google Maps API
- APIs use objects
- Include Google maps in your page
- Getting JSON data with SQL and PHP
- Points on a map are markers
- Multicreature checklist
- Listening for map events
- You did it!
- Your jQuery API Toolbox
- Leaving town...
- It’s been great having you in jQueryville!
- A. Leftovers: The Top Ten Things (We Didn’t Cover)
-
B. Set Up a Development Environment: Get Ready for the Big Times
- Create a PHP development environment
- Find out what you have
- Do you have a web server?
- Do you have PHP? Which version?
- Do you have MySQL? Which version?
- Start with the web server
- Apache installation...concluded
- PHP installation
- PHP installation steps
- PHP installation steps...concluded
- Installing MySQL
- Steps to install MySQL on Windows
- Enabling PHP on Mac OS X
- Steps to install MySQL on Mac OS X
- Index
- About the Authors
- Copyright
Product information
- Title: Head First jQuery
- Author(s):
- Release date: September 2011
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449393212
You might also like
book
Code: The Hidden Language of Computer Hardware and Software, 2nd Edition
Computers are everywhere --- most obviously in our laptops and smartphones, but also our cars, televisions, …
book
Arithmetic and Logic in Computer Systems
Arithmetic and Logic in Computer Systems provides a useful guide to a fundamental subject of computer …
audiobook
Fall in Love with the Problem, Not the Solution
Unicorns-companies that reach a valuation of more than $1 billion-are rare. Uri Levine has built two. …
book
Resonate: Present Visual Stories that Transform Audiences
Product Description Presentations are meant to inform, inspire, and persuade audiences. So why then do so …