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

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -