12.07.2015 Views

Pro JavaScript for Web Apps pdf - EBook Free Download

Pro JavaScript for Web Apps pdf - EBook Free Download

Pro JavaScript for Web Apps pdf - EBook Free Download

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 1 GETTING READYWhat Do You Need to Know Be<strong>for</strong>e You Read This Book?This is an advanced book, and you need to be an experienced web programmer to understand thecontent. You need a working knowledge of HTML, you need to know how to write <strong>JavaScript</strong>, and youhave used both to create client-side web apps. You will need to understand how a browser works, howHTTP fits into the picture, and what Ajax requests are and why you should care about them.What If You Don’t Have That Experience?You may still get some benefit from this book, but you will have to figure out some of the basics on yourown. I have written a couple of other books you might find useful as primers <strong>for</strong> this one. If you are newto HTML, then read The Definitive Guide to HTML5. This explains everything you need to create regularweb content and basic web apps. I explain how to use HTML markup and CSS3 (including the newHTML5 elements) and how to use the DOM API and the HTML5 APIs (including a <strong>JavaScript</strong> primer ifyou are new to the language). I make a lot of use of jQuery in this book. I provide all of the in<strong>for</strong>mationyou need <strong>for</strong> each topic, but if you want a better grounding in how jQuery works and how it relates to theDOM API, then read <strong>Pro</strong> jQuery. Both of these books are published by Apress.Books aside, you can learn a lot about HTML and the browser APIs by reading the specificationspublished by the W3C at www.w3.org. The specifications are authoritative but can be hard-going and arenot always that clear. A more readily accessible resource is the Mozilla Developer Network athttp://developer.mozilla.org. This is an excellent source of in<strong>for</strong>mation about everything from HTMLto <strong>JavaScript</strong>. There is a general bias toward Firefox, but this isn’t usually a problem since themainstream browsers are generally compliant and consistent in the way they implement web standards.Is This a Book About HTML5?No, although I do talk about some of the new HTML5 <strong>JavaScript</strong> APIs. Most of this book is abouttechnique, most of which will work with HTML4 just as it does with HTML5. Some chapters are builtpurely on HTML5 APIs (such as Chapters 5 and 6, which show you how to create web apps that workoffline and how to store data in the browser), but the other chapters are not tied to any particular versionof HTML. I don’t get into any detail about the new elements described in HTML5. This is a book aboutprogramming, and the new elements don’t have much impact on <strong>JavaScript</strong> programming.What Is the Structure of This Book?In Chapter 2, I build a simple web app <strong>for</strong> a fictitious cheese retailer called CheeseLux, building on thebasic example I introduce later in this chapter. I follow some pretty standard approaches <strong>for</strong> creatingthis web app and spend the rest of the book showing you how to apply industrial-strength techniques toimprove different aspects. I have tried to keep each chapter reasonably separate, but this is a reasonablyin<strong>for</strong>mal book, and I do introduce some concepts gradually over a number of chapters. Each chapterbuilds on the techniques introduced in the chapters that go be<strong>for</strong>e it. You should read the book inchapter order if you can. The following sections summarize the chapters in this book.Chapter 1: Getting ReadyAside from describing this book, I introduce the static HTML version of the CheeseLux example, which Iuse throughout this book. I also list the software you will need if you want to re-create the examples onyour own or experiment with the listings that are included in the source code download thataccompanies this book (and which is available free from Apress.com).2www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!