jquery - Node.js: How to pass route parameters while specifying a url in an AJAX POST request? -


i have post route in node application so,

app.post('/portfolio/:name/:id/:comment_parent', function(req, res){   ... }); 

inside callback body, save entry mysql database. need route params since go column entry database. want make whole process asynchronous using ajax, after searching on internet found no way of passing route params url attribute of ajax post request. idea how accomplish this?

solved using ajax script inside ejs template. way can directly append route params url. main problem send these parameters ejs js file, using script tag in ejs helped this.


Comments

Popular posts from this blog

c++ - CPP, 'X' button listener -

shared memory - gstreamer shmsrc and shmsink with h264 data -

.net - Bulk insert via Dapper is slower than inserting rows one-by-one -