Talking to your CouchDB backend from your HTML/Javascript frontend should have been trivial. CouchDB provides a RESTful API – that means it can be directly accessed through Ajax/Javascript. But, as ever, there is a “but”.
...
Today in the official CakePHP google group I proclaimed with poise that having PHP helpers for outputting JS (like CakePHP’s JS and Ajax helpers) is a very bad idea. And then someone from the group asked me if I have any argument to defend that. Here are the points that I posted there: ...