【发布时间】:2015-03-22 03:48:08
【问题描述】:
我正在使用 jQuery 向服务器发送 Ajax 请求,下面是代码 sn-p。
$.ajax({
type: 'POST',
url: "https://store.example.com/account?",
data: "cf=cw&operation=update"
})
当然,“请求的页面”和“Ajax 请求的 URL”在同一个域中。尽管如此,我还是在浏览器控制台中看到了指定的错误消息,并且无法使用 JavaScript/jQuery 读取响应。请在这里帮助我。
错误信息:XMLHttpRequest 无法加载 https://store.example.com/account?。没有“访问控制允许来源” 请求的资源上存在标头。起源 'http://store.example.com' 因此不允许访问。
【问题讨论】:
标签: jquery ajax cross-domain