Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1091945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:36:36+00:00 2026-05-16T23:36:36+00:00

I’m trying to create a simple AJAX (via jQuery) request to http:// yourusername .couchone.com/

  • 0

I’m trying to create a simple AJAX (via jQuery) request to http://yourusername.couchone.com/ (alsmost the same as if I had installed couchdb on localhost)

If I go to http://**yourusername**.couchone.com/ via Browser I’ll get:
{"couchdb":"Welcome","version":"1.0.1"} So, it looks like a serialized JSON.

So I wrote a JS Code:

$(function() {
        $.getJSON('http://www.********.couchone.com/', function(data) {
                console.log(data.couchdb);
                console.log(data.version);

            });
    });

But the code doesn’t work. FireBug’s console shows that the GET request has no response (the whole line is in red) Everything I can see is a Request-Header and Response-Header, but NO DATA (as response)

Request-Header :

Host :  www.*******.couchone.com
User-Agent :    Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 FirePHP/0.4
Accept :    application/json, text/javascript, */*
Accept-Language :   de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding :   gzip,deflate
Accept-Charset :    ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive :    115
Connection :    keep-alive
Origin :    null

Response-Header :

Server :    CouchDB/1.0.1 (Erlang OTP/R13B)
Date :  Sun, 26 Sep 2010 12:45:47 GMT
Content-Type :  application/json
Content-Length :  40
Cache-Control :  must-revalidate

Ideas? Suggestions?

P.S. Sorry for bad English

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:36:37+00:00Added an answer on May 16, 2026 at 11:36 pm

    Cross-site security model prevents you from doing JSON requests to a different domain.

    You need to use JSONP to be able to accomplish that. It does the request as a <script> include instead of an XMLHTTPRequest. <script> includes do not have the same security model.

    I don’t know if couchdb supports JSONP though. Usually the request for JSONP looks like this:

    http://someUrl/somePath?jsonp=mycallback
    

    The response data reads that jsonp parameter and returns valid javascript to execute in the parent page’s contenxt:

    myCallback({ JSON:data, JSON:data });
    

    You have to be sure you trust the JSONP provider, because you’re essentially giving them javascript execution access to your page. In your case you probably do since it’s your own couchdb database.

    There is no other solution, standard $.getJSON() will not work if the passed URL is not the same domain as your page.

    P.S. I looked at couchone.com, and I don’t see anything which suggests they support JSONP. You’re going to need your own server-side wrapper script that simply forwards the request to couchone and sends back the response wholesale (which has the advantage of hiding your actual couchdb provider URL), or else to find a different provider which supports JSONP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.