我试图用ajax发送数据:
var id_cookie = read_cookie('replay_id');
id_cookie = JSON.stringify(id_cookie);
$.ajax({
url: remote_ip+':8124/show_replay',
data: {cookie: id_cookie},
dataType: "jsonp",
jsonpCallback: "start_replay",
cache: false,
timeout: 5000,
success: function(data) {
console.log("Received data: "+data);
console.log(data);
},
error: function(jqXHR, textStatus, errorThrown) {
alert('error ' + textStatus + " " + errorThrown);
}
});
当我收到它时,我想访问数据
else if (req.method === "GET") {
// 在这里对发送的数据做一些事情。req.data 未定义。我怎样才能达到它?