I send ajax request:
var dataString = "{u:" + user + ", p:" + pa + "}";
$.ajax({
type: "POST",
url: "lg.html",
data: dataString,
success: function(data){
if(data){
window.location = "http://localhost:8001/ea.html";
}
else{
console.log(data);
}
}
});
Now, I have my server in node.js:
http.createServer(req).listen(8000);
function req(request, response){}
I want to get my form data attribute, so I do the next:
request.data;
but I see that req.data is undefined. How I can get my data attribute?