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

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -