Skip to content

Instantly share code, notes, and snippets.

@kybernetikos
Created April 26, 2011 09:47
Show Gist options
  • Save kybernetikos/942047 to your computer and use it in GitHub Desktop.
Save kybernetikos/942047 to your computer and use it in GitHub Desktop.
An attachment that can be put on a couchdb document to allow you to avoid the cross domain issue when using the Javascript API from a web page served from a different port on the same host (e.g. from a separate tomcat). It's very useful for development.
<html>
<head>
<script type="text/javascript" src="/_utils/script/couch.js"></script>
<script type="text/javascript">
document.domain = window.location.hostname;
if (window.parent.oncouchready) {
window.parent.oncouchready(CouchDB);
}
</script>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment