Beginning CouchDB Errata

Whilst I am on the subject of CouchApps, there is a typo in code listing 10-4 on page 171 of Beginning CouchDB which causes the javascript to not work. Specifically, if you get a message along the following lines in your browser’s error console:

    $.CouchApp is not a function

You can fix this by  making an edit at the bottom of listing 10-4, in the last <script> line it should read:

<script src="vendor/couchapp/jquery.couch.app.js"></script>


instead of:

<script src="vendor/couchapp/jquery.couchapp.js"></script>


Notice the missing period between couch and app? Enough to stump a beginner for hours!

Addendum #1 – A missing $ in listing 10-6 for main.js on page 176 in the parseInt line:

var task_count = parseInt('#task_count span').html(), 10);


should be:

var task_count = parseInt($('#task_count span').html(), 10);

Posted
Views
Filed under: