注:错误返回:Failed to load http://xxxxxxxxxxx: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://m.cd.com' is therefore not allowed access 如: $.post("http://",data,function(result){ console.log(result); aler…
我的代码是这么写的 window.onload=function(){ function sendRequest(){ var script=document.getElementById("script"); //360接口问题 script.src="http://tq.360.cn/api/weatherquery/querys?app=tq360&code=101010200&_jsonp=callback"; document.body.a…
先说下需求:在原来的WebApi项目中增加对js跨域的请求支持,请求方式:以POST为主,webapi路由规则根据原项目需求修改如下: public static void Register(HttpConfiguration config) { // Web API configuration and services // Web API routes config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "De…