在我的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"
非常感谢任何形式的帮助。
答案 0 :(得分:1)
没有限制。只要服务器正在运行,它就必须完美运行。