Debug the JavaScript code running in a desktop browser.
This procedure shows how to debug using Chrome. See https://developers.google.com/chrome-developer-tools/. In some cases, debugging on the device is necessary, for example, when you debug touch, or code that includes JavaScript files from Apache Cordova or Kapsel, since these expect to run on a mobile device or simulator.