标签:control ror cors ... 服务 ade type .ajax text
1.服务端
搁response中增加Access-Control-Allow-Origin:‘*’
eg: context.Response.AddHeader(
"Access-Control-Allow-Origin"
,
"*"
);
2.前端
同样发送ajax请求
$.ajax({
type:‘method‘ //GET POST HEAD都行
url:‘croll-domain-url’,
xhrFields:{
withCredentials:true //允许带cookie跨域
},
headers:{...},
success:function() {...},
error:function() {...}
})
标签:control ror cors ... 服务 ade type .ajax text
原文地址:http://www.cnblogs.com/itbainianmei/p/6555493.html