想用ajax连接WebService,做一个动态的界面,但每次调用ajax都是如下报错,求大神指点,怎么设置
[Web浏览器] "XMLHttpRequest cannot load http://localhost:6438/web.aspx?name=123. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8020' is therefore not allowed access." /334/login.html (0)
3 个回复
王者地带 - 5+混合APP开发教程网 | http://www.html5-app.com | 咨询QQ: 2564034335
'Access-Control-Allow-Origin ,是ajax,跨域访问数据问题,关于.net后端跨域怎么配置,请百度一下
雪之梦技术驿站 - 你在互联网的路上匆匆而来,雪之梦技术驿站助你满载而去
后台运行跨域才行
回梦無痕 - 暂停服务
看到了http://127.0.0.1:8020。
首先localhost域下的aspx服务器需要设置允许跨域,
其次,这个是本地运行项目吧?本地运行是直接走js,没有走plus跨域请求。