Saturday 10 February 2018

Node and Ajax doubts

Hi, so i recently started making my own webserver with express, and it's nice for handling everything without having to use the standard api, but i came across a problem:mammaMI.use(xpress.static("./")); mammaMI.get("/postcontent", function(req, res){ console.log("logged"); }) mammaMI.listen(80); I tried sending a post request to /postcontent, but it doesn't get it! Here is my JavaScript(i used alert("") to check if it executed, and it did):function postContent(){ alert("hei"); var conn = new XMLHttpRequest(); alert("2"); conn.open("POST", "/postcontent", true); alert("3"); conn.send("hihi"); alert("4"); };

Submitted February 10, 2018 at 12:21PM by AnonymousAlien11

No comments:

Post a Comment