jQuery on click function not working to work with express to route to a handlebars page to display passed information.
I've tried changing the get to post. Not using handlebars and just having in html file and using path.sendFile or chaning res.render to be res.send
Heres the on click function
$("#song").on("click", function(){
var songArtist = $(this).text();
$.get("/results/:" + songArtist);
});
Heres the express route
app.get("/results/:songArtist", function(req, res) {
res.render("songResult");
//res.sendFile(path.join(__dirname + "./../views/result.html"));
});
I expect that when the divs with the song id is clicked to load to a new page.