javascript - Getting data from ajax -
im trying send data 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); } }); and when receive want access data
else if (req.method === "get") { // sent data here. req.data undefined. how can reach it?
in php, value of "cookie" parameter, can use:
$_get["cookie"] if you're not sure if or post, can use:
$_request["cookie"] i'd change name of data you're sending "cookie" less ambiguous, avoid confusion actual cookies.
Comments
Post a Comment