$.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, dataType: 'jsonp', jsonp: "jsoncallback", success: function (data) { } }); } function jsoncallback(resultData) { if (resultData.result.status.msg == "succ") { alert(" 您抽中了优惠券,请到APP中领取"); } else { alert(" 很遗憾,您没能抽中优惠券"); } }