ajax跨域请求

来源:互联网 发布:彗星dns优化器安卓 编辑:程序博客网 时间:2024/04/30 11:56

解决方法:

第一步:后台java有jsoup插件

第二步:struts.xml 

<action name="appQbfxAction_*"class="appQbfxAction" method="{1}"><result type="json"><param name="callbackParameter">callback</param><param name="root">qbfxResult</param></result></action>

第三步:ajax请求如下:

$.ajax({async : false,data:"id=100&typeId="+1,dataType : 'jsonp',---------------------------json变成jsonptype : 'post',url : "http://192.168.50.16:8081/wlszb-view/appQbfxAction_qblPie.action",success : sucQblPie,error : function() {alert("error1111");}});


0 0
原创粉丝点击