skip to Main Content

How to send data using jQuery ajax

this is my html <!-- <form action="view.php" method="post"> --> <input type="text" name="text" id="name"> <input type="submit" value="submit"> <!-- </form> --> I don't want to send the data by using form Couse it only send named attribute data that's why I am…

VIEW QUESTION

Mongodb – how to send data to mongo via URL?

i post data to mongodb as following: app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended:true})); app.use('/insert',async(req,res)=>{ const newProduct=new product({ _id:req.body._id, name:req.body.name, description:req.body.description }); try{ await newProduct.save(); // res.json(newProduct); res.send(`${newProduct} inserted.`); //res.redirect('/'); } catch(err){ res.send(err); } }); Data is taken from the user. The user sends the…

VIEW QUESTION
Back To Top
Search