jQuery AJAX Cross Domain with BASIC Authentication

前端 未结 3 1233
轻奢々
轻奢々 2021-01-14 18:22

I\'m attempting to make use of the Beanstalk (beanstalkapp.com) API by pulling data into a webpage so people can view it without accessing my SVN.

What I\'m doing to

相关标签:
3条回答
  • 2021-01-14 18:59

    Check this jsfiddle. The username and password is incorrect. Give the correct username and password and check it once again.

    0 讨论(0)
  • 2021-01-14 19:03

    You will need to make proxy for cross-domain ajax requests.

    Usual scenario looks like this:

    1. Client send ajax request to server
    2. Your server forwards request to external/remote server
    3. Waiting on response from remote server
    4. Parse and process response from remote server
    5. Send response back to client

    If you are using php you can send requests with curl, and it is pretty easy to implement. I have wrote article on this topic recently http://www.svlada.com/proxy-ajax-requests-curl-and-symfony-2/.

    0 讨论(0)
  • 2021-01-14 19:07

    you cant get a json from other domain than yours. this is a security issue called same origin policy to get over it use JSONP not JSON.

    0 讨论(0)
提交回复
热议问题