0

I'm using jquery to post results:

 $(document).ready(function(){            

          $("#submit").click(function(){                                      
                   $.post("/addGrade", 
              {"name": "test"},
              function(data, status)
              {     
                console.log("OK");
                $("#rc").val("OK");                                           
                      });

    }); // fnction

 }); // ready

but I'm getting undefined results:

var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser.json())



app.post('/addGrade', function(req, res) {
  console.log("[/addGrade] Got New Grade: " + req.body.name);
  res.send("OK");
});

In Node.js log I can see: "[/addGrade] Got New Grade: undefined"

What am I missing ?

user3668129
  • 4,318
  • 6
  • 45
  • 87

0 Answers0