AJAX请求跨域的问题

前端之家收集整理的这篇文章主要介绍了AJAX请求跨域的问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
$.ajax({
type: "post",url: "http://192.168.1.100:12806/Mine/DisCount.aspx?action=GetDiscountPoolForJsonp&type=name&typevalue=" + encodeURI("注册有奖"),dataType: 'jsonp',jsonp: "getDiscountForUserByPoolId",//data: { action: "GetDiscountPool",type: "name",typevalue: "注册有奖" },success: function (pooldata) {
var succ = pooldata;
},error: function (errordata) {
var err = errordata;
}
});

 function getDiscountForUserByPoolId(pooldata) {
    var userId=$("#hide_userId").val();
        $.ajax({
            url: "http://192.168.1.100:12806/Mine/DisCount.aspx?action=GetDiscountForUserByPoolIdForJsonp&poolId=" + pooldata.result.data.M_DiscountPoolId + "&UserID=" + userId,jsonp: "jsoncallback",success: function (data) {

            }
        });
    }


    function jsoncallback(resultData) {
        if (resultData.result.status.msg == "succ") {
            alert(" 您抽中了优惠券,请到APP中领取");
        } else {
            alert(" 很遗憾,您没能抽中优惠券");
        }
    }

猜你在找的Ajax相关文章