Access-Control-Allow-Origin error sending a jQuery Post to Google API's

前端 未结 7 1655
小蘑菇
小蘑菇 2020-11-22 14:04

I read a lot for the \'Access-Control-Allow-Origin\' error, but I don\'t understand what I have to fix :(

I\'m playing with Google Moderator API, but when I try to a

相关标签:
7条回答
  • 2020-11-22 14:44

    Yes, the moment jQuery sees the URL belongs to a different domain, it assumes that call as a cross domain call, thus crossdomain:true is not required here.

    Also, important to note that you cannot make a synchronous call with $.ajax if your URL belongs to a different domain (cross domain) or you are using JSONP. Only async calls are allowed.

    Note: you can call the service synchronously if you specify the async:false with your request.

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