ajax 跨域请求
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
</head>
<body>
<!-- 底部菜单 -->
<div id="pageBottom"></div>
<script src="js/jquery-2.1.0.js"></script>
<script type="text/javascript" charset="utf-8">
$.ajax({
url : 'http://221.0.93.122:8180/fuchainApi/api/querySupplyHall.shtml',
type : 'GET',
dataType : 'JSONP',
jsonp: "callback",
jsonpCallback:"successCallback",
contentType: "application/json;charset=UTF-8",
data : {
callback : 'jsonp'
},
success : function(data) {
debugger;
alert(data);
console.log(data.msg);
},
error : function(e) {
alert("未联网或无法连接服务器");
}
});
</script>
</body>
</html>