views:

65

answers:

2

Hello,

i've got a little problem with AJAX, CouchDB and JavaScript.

I can open the following URL from CouchDB in my browser: http://192.168.1.58:5984/mydb/name

new Ajax.Request('http://192.168.1.58:5984/mydb/namee', {
  method: 'POST',
  onComplete: function(transport) {
   alert(transport.responseText);
  }
 });

I always get empty alert.

Can you help me?

+2  A: 

AJAX doesn't support cross domain scripting. all calls need to be to a URL with the same domain as the one of the current document. a good solution would be to build a proxy service on the server side, that will take the local request, make an HTTP call to the couchDB server, and return it's response.

ozk