client from localhost:8880 calls server from localhost:8880 but gets Cross origin requests are only supported

浪子不回头ぞ 提交于 2019-12-12 01:25:42

问题


I have an html page with angular2 on url:

http://localhost:8880/SupporTool/html/angular2/index.html#

which call server on

localhost:8880/SupporTool/Push/SelectMessagesAttributes

how come i get

Cross origin requests are only supported..


回答1:


one has to disable same origin policy in Chrome. It blocks all calls from localhost to itself.

start chrome with the --disable-web-security flag



来源:https://stackoverflow.com/questions/39019403/client-from-localhost8880-calls-server-from-localhost8880-but-gets-cross-origi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!