如何在JSONP Ajax调用中使用类型:“POST”我正在使用JQueryAjaxJSONP。我在下面jQuery代码: $.ajax({
type:"GET",
url: "Login.aspx", // Send the login info to this page
data: str,
dataType: "jsonp",
timeout: 200000,
jsonp:"skywardDetails",
success: function(result)
{
// Show 'Submit' Button
$('#loginButton').show();
// Hide Gif Spinning Rotator
$('#ajaxloading').hide();
}
});上面的代码运行良好,我只想将请求发送给“职位”而不是“得到”,请建议我如何做到这一点。谢谢
3 回答
繁星点点滴滴
TA贡献1803条经验 获得超3个赞
json
dataType
$.ajax({ url: "your url which return json", type: "POST", crossDomain: true, data: data, dataType: "json", success:function(result){ alert(JSON.stringify(result)); }, error:function(xhr,status,error){ alert(status); } });
header('Access-Control-Allow-Origin: *');header('Access-Control-Allow-Methods: POST');header('Access-Control-Max-Age: 1000');
response.addHeader( "Access-Control-Allow-Origin", "*" ); response.addHeader( "Access-Control-Allow-Methods", "POST" ); response.addHeader( "Access-Control-Max-Age", "1000" );
添加回答
举报
0/150
提交
取消