Debugging in Chrome or Firefox is pretty easy thanks to tools like the built in Chrome debugger or Firebug. However, once you get your app onto a mobile device it can be very difficult since these tools are not available there. A great option is to use the JavaScript API ‘console.log’ and a tool called jsconsole.com. With JSConsole you can connect to any web page running the JSConsole remote script from within the JSConsole web app. Simply add the following script tag to your HTML:
<script src="http://jsconsole.com/remote.js?random_id"></script>
Where <random_id> is anything you want. Preferably something easy to remember. Then go to http://jsconsole.com and in the box type
:listen <random_id>
Then when you refresh the page on your mobile device, all the console.log output will be echo’ed to the jsconsole.com web page.
More information can be found here: