benvinegar / couchdb-xd Goto Github PK
View Code? Open in Web Editor NEWCross-domain AJAX for CouchDB
License: MIT License
Cross-domain AJAX for CouchDB
License: MIT License
Uncaught ReferenceError: pmxdr is not defined couchdb.js:95
pdmx-host fails on line 118 with error
Uncaught Error: SYNTAX_ERR: DOM Exception 12
when trying to do the following request:
Couch.init(function() {
console.log('couchdb-xd initialized');
var server = new Couch.Server("http://nicolaslara.iriscouch.com");
var db = new Couch.Database(server, "messages");
db.get("test", function(resp){ alert(resp); })
});
});
The database is publicly available, so you can access the document at http://nicolaslara.iriscouch.com/messages/test/. The document was put with couchdb-xd. Putting also throws the same exception but the document gets into the DB (as the error is happening while reading the successful response)
The HTML I'm using to include the code is also pretty simple:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://nicolaslara.iriscouch.com/couchdb-xd/_design/couchdb-xd/couchdb.js" type="text/javascript"></script>
<script src="database.js"></script>
</head>
<body>
</body>
</html>
PUTs work just fine, but I get a result 415 when I POST:
Couch.init(function() {
var server = new Couch.Server('http://localhost:5984');
var db = new Couch.Database(server, 'dbname');
db.post({ hello: 'world' }, function(resp) { });
});
Seems it might be an issue with the content type? Thanks, wonderful library.
Hi,
I tried the couchdb-xd with couchdb 1.1.0 and I get the following error for this piece of code:
Error from Firefox Web-Console:
[13:15:05.889] uncaught exception: [Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)" location: "http://localhost:5984/couchdb-xd/_design/couchdb-xd/lib/pmdxr-host.js Line: 118"]
Code:
<script src="http://localhost:5984/couchdb-xd/_design/couchdb-xd/couchdb.js" type="text/javascript"></script>
<script type="text/javascript">
Couch.init(function() {
// execute on ready
var server = new Couch.Server('http://localhost:5984');
server.get(server, 'mydb', function(resp) {
console.log(resp);
});
});
Is this an unknown error or do I use it wrong???
Thanks,
Amir
Request headers are set as application-xml when saving..but couched requires application-json request headers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.