AJAX请求跨域的问题
发布时间:2020-12-16 01:44:27 所属栏目:百科 来源:网络整理
导读:$.ajax({type: "post",url: "http://192.168.1.100:12806/Mine/DisCount.aspx?action=GetDiscountPoolForJsonptype=nametypevalue=" + encodeURI("注册有奖"),dataType: 'jsonp',jsonp: "getDiscountForUserByPoolId",//data: { action: "GetDiscountPool",t
$.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(" 很遗憾,您没能抽中优惠券"); } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |