Who is this book for?
We know what you’re thinking
And we know what your brain is thinking
Metacognition: thinking about thinking
The technical review team
Introducing the HTML5-o-Matic, update your HTML now!
You’re closer to HTML5 markup than you think!
Declaring a variable
How to name your variables
Doing things over and over
Making more decisions... and, adding a catchall
How to bake your very own DOM
A first taste of the DOM
So, what else is a DOM good for anyway?
Get ready for Webville Tunes
But nothing happens when I click “Add Song”
Getting access to the “Add Song” button
Giving the button a click handler
A closer look at what just happened
Getting the song name
How do we add a song to the page?
Anatomy of a Function
Local and Global Variables
Knowing the scope of your local and global variables
Oh, did we mention functions are also values?
Did someone say “Objects”?!
Some things you can do with objects
Let's talk about passing objects to functions
Objects can have behavior too
Meanwhile back at Webville Cinema
Adding the “this” keyword
How to create a constructor
How does this really work?
Test drive your constructor right off the factory floor
What is the window object anyway?
A closer look at window.onload
Another look at the document object
A closer look at document.getElementById
One more object to think about: your element objects
Location, Location, Location
The Lat and Long of it
How the Geolocation API determines your location
Just where are you anyway?
Time to get moving!
You’ve got some Options
The world of timeouts and maximum age
Let’s finish this app!
Integrating our new function
Mighty Gumball wants a
A little more background on Mighty Gumball
So how do we make requests to web services?
Move over XML, meet JSON
Writing an onload handler function
Displaying the gumball sales data
How to set up your own Web Server
Reworking our code to make use of JSON
Moving to the Live Server
It’s a cliffhanger!
Remember, we left you with a
cliffhanger? A bug
What Browser Security Policy?
So, what are our options?
Step 3: Reimplementing JSONP
How to remove duplicate sales reports
Updating the JSON URL to include the lastreporttime
Our new start-up: TweetShirt
Checking out the “comps”
How to get a canvas into your web page
How to see your canvas
Drawing on the Canvas
TweetShirt: the Big Picture
First, let’s get the HTML in place
Now, let’s add the <form>
Writing the drawSquare function
Add the call to fillBackgroundColor
Meanwhile, back at TweetShirt.com
Drawing with Geeks
Breaking down the arc method
A little taste of using the arc
I say degree, you say radian
Back to writing the TweetShirt circle code
Writing the drawCircle function
Getting your tweets
Canvas Text Up Close
Giving drawText a spin
Completing the drawText function
Meet Webville TV
Plug that set in and test it out
How does the video element work?
Closely inspecting the video attributes
How to juggle all those formats
I was told there would be APIs?
A little content “programming” on Webville TV
How to write the “end of video” handler
How the canPlayType method works
Unpacking the Demo Unit
Inspecting the rest of the factory code
The setEffect and setVideo handlers
Implementing the video controls
Switching test videos
It’s time for special effects
How video processing works
How to process video using a scratch buffer
Implementing a scratch buffer with Canvas
Now we need to write some effects
How to use error events
How browser storage works (1995 - 2010)
How HTML5 Web Storage works
Were Local Storage and the Array separated at birth?
Creating the interface
Completing the user interface
We need to stop for a little scheduled service
Using the new stickyObj
The Dreaded Slow Script
When single-threaded goes BAD
Adding another thread of control to help
how web workers work
How Web Workers work
Your first Web Worker
Receiving messages from the worker
Now let’s write the worker
Virtual Land Grab
How to compute a Mandelbrot Set
How to use multiple workers
Let’s build the Fractal Explorer app
Creating workers, and giving them tasks
Writing the code
Getting the workers started
Implementing the worker
Fitting the canvas to the browser window
The anal-retentive chef coder
IN THE LABORATORY
The HTML5 Guide to New Construction
Webville Guide to CSS3 Properties