No 'Access-Control-Allow-Origin' header is present on the requested resource.
来源:互联网 发布:申请淘宝达人的步骤 编辑:程序博客网 时间:2024/04/27 23:39
跨域请求的解决方案。
$.ajax({
dataType: 'JSONP',
type: "GET",
url: "http://dzd.wddcn.com/vshop/addr.html?action=region&level=3&value=" + district.value,
success: function (tjson) {
if (region_cb) {
region_cb('t', tjson);
}
for (var i = 0; i < tjson.length; i++) {
town.options.add(new Option(tjson[i].name, tjson[i].id));
}
if (arr.length > 3 && arr[3] != "" && arr[3] != "-1") {
town.value = arr[3];
}
}
});
如果用ajax请求type改成JSONP就可以了。
0 0
- No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin is therefore no
- No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '***' is theref
- No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '
- No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin
- No 'Access-Control-Allow-Origin' header is present on the requested resource. 报错解决。
- 解决“No 'Access-Control-Allow-Origin' header is present on the requested resource”
- 解决“No 'Access-Control-Allow-Origin' header is present on the requested resource.”
- No 'Access-Control-Allow-Origin' header is present on the requested resource 的解决方法
- “No 'Access-Control-Allow-Origin' header is present on the requested resource”
- 报No 'Access-Control-Allow-Origin' header is present on the requested resource
- 跨域问题:No 'Access-Control-Allow-Origin' header is present on the requested resource.
- jquery ajax No 'Access-Control-Allow-Origin' header is present on the requested resource
- No 'Access-Control-Allow-Origin' header is present on the requested resource
- No 'Access-Control-Allow-Origin' header is present on the requested resource.
- No 'Access-Control-Allow-Origin' header is present on the requested resource
- No 'Access-Control-Allow-Origin' header is present on the requested resource
- No 'Access-Control-Allow-Origin' header is present on the requested resource
- “No 'Access-Control-Allow-Origin' header is present on the requested resource”
- HDU-2159-FATE(二维完全背包)
- 给ViewController添加BarButton
- PHP学习总结(14)——PHP入门篇之常用运算符
- C Primer Plus学习 三十七 具有外部链接的静态变置
- java中Map,List与Set的区别
- No 'Access-Control-Allow-Origin' header is present on the requested resource.
- vagrant box配置本地开发环境以及常见错误解决方案
- 什么是SOA,谈谈自己的看法(转)
- 【并行计算-CUDA开发】浅谈GPU并行计算新趋势
- mysql性能优化
- scrollLeft等属性介绍
- Android学习笔记——从零开始的闹钟开发(一)
- 前端CSS技术全解(一)
- 多种点标签专题图