jQuery跨域

使用jsonp

$.ajax({
 type: "POST",
    url: "http://www.baidu.com/",
    data: { "calltype": "2", "jsonParm": '{"pageIndex":1,"pageSize":10,"userId":"0","currentUserId":"180"}' },
    crossDomain: true,
    dataType: "jsonp",
    success: function (data, status) 
    {
        alert(data.refresh);
    },
    error: function (xhr, status) 
    {
        console.log("ajax error!");
    }
});

你可能感兴趣的:(jQuery跨域)