I have a row made in jade that looks like this tr(data-href="http://localhost:3000/patient/" + patients[0].patient[g]["number"]).clickable-row
this outputs to the HTML as viewed in the console
<tr class="clickable-row" data-href="http://localhost:3000/patient/2">
when I click the row I get directed to http://localhost:3000/null
I tried changing http://localhost:3000/patient/"
in the string to a lot of different things like url:/patient/
. I got this click row to open new page method from here.
script:
$(".clickable-row").live("click",function(){
window.document.location = $(this).data("href");
}) //using live because old version of jquery
app.js
app.get("/patient/:param1", function(req, res){
res.send(req.params)
})
expected results: when user clicks a row they go to a page that has a url like localhost:3000/patient/2
EDIT: I think I have problem setting up the URL. I never had a good understanding of relative and absolute paths. and I had errors like this before when I needed to have a public folder to get static files.