前端服务localhost:8081为什么没跨域

来源:5-15 被调用方解决跨域 - nginx解决方案

Kevin6_Wong

2020-12-30 23:27

在前端启动的服务localhost:8081;

调用b.com的接口,这层为什么没跨域呢?

location:        localhost:8081

ajax:              $.get('http://b.com/test/xxx.json');


在 localhost:8081访问b.com 浏览器应该会报出跨域?

写回答 关注

1回答

  • 慕梦前来
    2021-07-04 11:31:06

    服务器支持了,前端走代理就好了,

ajax跨域完全讲解

完全讲解Ajax跨域产生的原因和解决思路,掌握跨域的各种解决方案

62568 学习 · 90 问题

查看课程

相似问题