O'Reilly logo

Mastering ArcGIS Server Development with JavaScript by Ken Doman

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

Using Knockout in our app

Let's make another copy of our jQuery app and name the folder Knockout. We will not need jQuery for this application, since we can use Knockout and the ArcGIS JavaScript API to handle those functions. We'll start by replacing all the references to jQuery with Knockout references. The dojoConfig script at the head of the document should look like the following:

dojoConfig = {
  async: true,
  packages: [
    {
      name: 'y2k',
      location: location.pathname.replace(/\/[^\/]*$/, '') + '/js'
   }, {
      name: "d3",
      location: "http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.12/"
    }, {
     name: "knockout",
     location: "http://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0",
     main: "knockout-min"
   }
  ]
};

Next, we'll add a reference to Knockout in our Census.js ...

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