Javascript ExtJS跨域问题
我是extjs新手,面临跨域问题Javascript ExtJS跨域问题,javascript,ajax,extjs,cross-domain,Javascript,Ajax,Extjs,Cross Domain,我是extjs新手,面临跨域问题 Ext.Ajax.request({ method: "POST", url:'url', params:{ ahq_id: '104', username:'', password:'', callback:'WCL_Parser', }, async: true, dataType: 'jsonp', success: function(resp
Ext.Ajax.request({
method: "POST",
url:'url',
params:{
ahq_id: '104',
username:'',
password:'',
callback:'WCL_Parser',
},
async: true,
dataType: 'jsonp',
success: function(response){
console.info(response);
}
});
我得到了错误的答案
XMLHttpRequest cannot load http://182.73.236.115:8080/WCLRESTService/rest/Map/showVehiclesOnMap. 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:8282' is therefore not allowed access.
甚至我也尝试过使用回调函数
function WCL_Parser(data){
console.info(data);
}
错误没有得到解决。提前感谢。您正在尝试获得JSONP答案,但使用的是Ajax请求。你到底在哪里找到了数据类型:“jsonp”;它不在ExtJS文档中。使用JsonP存储并完成它。你能帮我举个例子吗