Skip to main content
Top

2012 | Book

Pro JavaScript for Web Apps

insite
SEARCH

About this book

JavaScript is the engine behind every web app, and a solid knowledge of it is essential for all modern web developers. Pro JavaScript for Web Apps gives you all of the information that you need to create professional, optimized, and efficient JavaScript applications that will run across all devices. It takes you through all aspects of modern JavaScript application creation, showing you how to combine JavaScript with the new features of HTML5 and CSS3 to make the most of the new web technologies.

The focus of the book is on creating professional web applications, ensuring that your app provides the best experience for your users, with smooth and responsive control and feedback and an intuitive and optimized interface. You will learn how to take a basic application and bring it up to a professional level while making sure that it remains bullet-proof and bug free. Pro JavaScript for Web Apps will also enhance your development workflow using jQuery to streamline the process and freeing you to spend more time on the important parts of your app while the framework deals with the mundanity.

The best app experiences are a combination of a beautiful idea with flawless execution. If you have the ideas, Pro JavaScript for Web Apps will help you craft them into a phenomenal app.

Table of Contents

Frontmatter
Chapter 1. Getting Ready
Abstract
Client-side web app development has always been the poor cousin to server-side coding. This started because browsers and the devices they run on have been less capable than enterprise-class servers. To provide any kind of serious web app functionality, the server had to do all of the heavy lifting for the browsers, which was pretty dumb and simple by comparison.
Adam Freeman
Chapter 2. Getting Started
Abstract
In this chapter, I am going to enhance the example web app I introduced in Chapter 1. These are the entry-level techniques, and most of the rest of the book is dedicated to showing you different ways to improve upon the result. That’s not to say that the examples in this chapter are not useful; they are absolutely fine for simple web apps. But they are not sufficient for large and complex web apps, which is why the chapters that follow explain how you can take key concepts from the world of server-side development and apply them to your web apps.
Adam Freeman
Chapter 3. Adding a View Model
Abstract
If you have done any serious desktop or server-side development, you will have encountered either the Model-View-Controller (MVC) design pattern or its derivative Model-View-View-Model (MVVM). I am not going to describe either pattern in any detail, other than to say that the core concept in both is separating the data, operations, and presentation of an application into separate components.
Adam Freeman
Chapter 4. Using URL Routing
Abstract
In this chapter, I will show you how to add another server-side concept to your web app: URL routing. The idea behind URL routing is very simple: we associate JavaScript functions with internal URLs. An internal URL is one that is relative to the current document and contains a hash fragment. In fact, they are usually expressed as just the hash fragment on its own, such as #summary.
Adam Freeman
Chapter 5. Creating Offline Web Apps
Abstract
The HTML5 specification includes support for the Application Cache, which is used to create web applications that are available to users even when no network connection is available. This is ideal if your users need to work offline or in environments where connectivity is constrained (such as on an airplane, for example).
Adam Freeman
Chapter 6. Storing Data in the Browser
Abstract
A natural complement to offline applications is client-side data storage. HTML5 defines some useful JavaScript APIs for storing data in the browser, ranging from simple name/value pairs to using a JavaScript object database. In this chapter, I show you how to build applications that rely on persistently stored data, including details of how to use such data in an offline web application.
Adam Freeman
Chapter 7. Creating Responsive Web Apps
Abstract
There are two approaches to targeting multiple platforms with a web app. The first is to create a different version of the app for each kind of device you want to target: desktop, smartphone, tablet, and so on. I’ll give you some examples of how to do this in Chapter 8.
Adam Freeman
Chapter 8. Creating Mobile Web Apps
Abstract
An alternative to creating a web app that adapts to the capabilities of different devices is to create a version that is specifically targeted to mobile devices. Choosing between a responsive web app and a mobile-specific implementation can be difficult, but my rule of thumb is that a mobile version makes sense when I want to offer a radically different experience to mobile and desktop users or when dealing with device constraints in a responsive implementation becomes unwieldy and overly complex. Your decision will, of course, depend on the specifics of your project, but this chapter is for when you decide that one version of your web app, however responsive, won’t cater to your mobile users’ needs.
Adam Freeman
Chapter 9. Writing Better JavaScript
Abstract
In this chapter, I explain some of the techniques I use to create better JavaScript. This is not a language guide, and I won’t be demonstrating any code hacks or tweaks. My coding preferences are your maintenance nightmares, and vice versa. I have seen otherwise mild-mannered people end up in a screaming match over the “right” way to code, and I don’t see the point in lecturing you when I have a fair few bad habits myself.
Adam Freeman
Backmatter
Metadata
Title
Pro JavaScript for Web Apps
Author
Adam Freeman
Copyright Year
2012
Publisher
Apress
Electronic ISBN
978-1-4302-4462-2
Print ISBN
978-1-4302-4461-5
DOI
https://doi.org/10.1007/978-1-4302-4462-2

Premium Partner