http://ip.taobao.com/service/getIpInfo.php?ip=114.222.51.186. Response to preflight request doesn't

XMLHttpRequest cannot load http://ip.taobao.com/service/getIpInfo.php?ip=114.222.51.186. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.

 

 

no access-control-allow-origin'header怎么设置 10

稻子E63YX | 浏览 16571 次

发布于2015-07-21 10:40最佳答案

跨域只能使用JSONP来实现,或者通过服务器端获取

另外,Access-Control-Allow-Origin 方法可以参考

http://blog.csdn.net/net_lover/article/details/5172509
http://blog.csdn.net/net_lover/article/details/5172522
http://blog.csdn.net/net_lover/article/details/5172532

 

 

No 'Access-Control-Allow-Origin' header is present on the requested resource.

你好,请问这个问题解决了吗

小钱被占用 | 浏览 12338 次

发布于2017-02-06 16:14最佳答案

$.ajax({ 

url:"http://yingyan.baidu.com/api/v3/entity/list"

type:'GET', 

 dataType:'JSONP',  // 处理Ajax跨域问题

success: function(data){

转载于:https://my.oschina.net/yizhichao/blog/1486267

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值