I wrote the the below code in the index.html page of bluemix:
$(document).ready(function() {
$("button").click(function() {
var Cloudant = require('cloudant');
var password = "#password";
var myAccount = "#accountname";
Cloudant({account:myAccount, password:password}, /* @callback */ function(err, cloudant,body) {
if (err) {
return ("Failed");
} else {
printTable(body);
}
});
I want to get a document from cloudant database and display it in a table.