Skip to content

Instantly share code, notes, and snippets.

@kybernetikos
Created April 26, 2011 10:04
Show Gist options
  • Save kybernetikos/942063 to your computer and use it in GitHub Desktop.
Save kybernetikos/942063 to your computer and use it in GitHub Desktop.
Uses https://gist.github.com/942047 to provide access to a separate couchdb running on a different port to the webserver that this file is loaded from. Assumes you've uploaded that couch-x.html file as an attachment to a document with id 'document' on a
<html>
<head>
<title>CouchTest</title>
<script>
document.domain = window.location.hostname;
window.oncouchready = function(api) {
CouchDB = api;
var database = new CouchDB("somedb");
// .. your code goes here..
}
</script>
</head>
<body>
<iframe style='display: none' src="http://localhost:5984/webaccess/document/couch-x.html"></iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment