■ CONTENTS
xvi
Automated Testing................................................................................................213
A/B Testing ...........................................................................................................214
Putting It All Together ..........................................................................................216
First, Create the Test Harness .....................................................................................216
Second, Create the SPEC.............................................................................................217
Third, Create the Validation Function...........................................................................217
Chapter Summary.................................................................................................217
Chapter 14: Advanced Topics ..........................................................................219
Cross-Domain Communication .............................................................................219
Before HTML5 ..............................................................................................................219
document.domain....................................................................................................220
Using a Proxy...........................................................................................................220
Including Scripts from Other Domains ....................................................................220
Document Messaging ..................................................................................................221
Server-Sent Events ...............................................................................................222
Web Sockets .........................................................................................................224
Web Workers ........................................................................................................225
History Management ............................................................................................227
Chapter Summary.................................................................................................228
Chapter 15: Going Native with PhoneGap ........................................................229
Installing PhoneGap..............................................................................................229
Enhancing Your App .............................................................................................233
Geolocation ..................................................................................................................233
Accelerometer .............................................................................................................234
Vibrate or Beep ............................................................................................................234
Using the Camera ........................................................................................................234
PhoneGap API Overview .......................................................................................235
Plugins..................................................................................................................238
A Plugin Example—NativeControls..............................................................................238
Mobile Web App Versus Native App......................................................................242
Putting It All Together ..........................................................................................243
The Home Page............................................................................................................244