O'Reilly logo

Web Development Recipes, 2nd Edition by Chris Johnson, Mike Weber, Chris Warren, Brian P. Hogan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recipe 14Snappier Client-Side Interfaces with Knockout.js

Problem

When developing modern web applications, we often try to update only part of the interface in response to user interaction instead of refreshing the entire page. Calls to the server are often expensive, and refreshing the entire page can cause users to lose their place.

Unfortunately, the JavaScript code for this can quickly become difficult to manage. We start out watching only a couple of events, but eventually we have several callbacks updating several regions of the page, which becomes a maintenance nightmare. We need an easy-to-use tool that keeps track of all of this for us.

Ingredients

Solution

Knockout.js is a simple yet powerful framework that lets us bind ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required