leohxj
9/20/2016 - 3:28 PM

Ajax CORS

Ajax CORS

// Zepto CORS
$.ajax({
    type: "get",
    url: url,
    data: data,
    xhrFields: {
        withCredentials: true
    },
    crossDomain: true,
    beforeSend: function() {
        console.log("beforeSend");
    },
    success: function(data) {
        console.log("success");
    },
    error: function() {
        console.log("error");
    },
    complete: function() {
        console.log("complete");
    }

})