跨域ajax从live到localhost无法正常工作

时间:2016-04-13 17:31:48

标签: cors

在我的localhost项目.htaccess文件中,我有这些行来启用CORS ajax。但我仍然收到以下错误:

XMLHttpRequest cannot load http://localhost/myapp/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://somdomain.com' is therefore not allowed access.


#Header add Access-Control-Allow-Origin "*"
#Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
#Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"

非常感谢任何形式的帮助。

1 个答案:

答案 0 :(得分:1)

没有限制。只要服务器正在运行,它就必须完美运行。