Tuesday 30 May 2017

Bizarre values are displayed when requesting parameters

I am displaying some items in my handlebars template as links. When I click on those links, it gets me to the right url with no errors. But for some reason, when I request parameters, among with the item name, I get img and jquery-1.11.2.js. The last one is a script element in my head file and I think img comes from the link element, but I am not sure. Why would they be displayed?

My template (handlebars) :

<div>
    
        <a href="/home/" class="btn btn-primary btn-large" role="button"></a>
    
</div>

My code :

app.get('/home/:program', function(req, res){
    console.log(req.params.program);
    res.render('groups');
});

Output :

`Bachelor`
`img`
`jquery-1.11.2.js`



via Rockasaurus

No comments:

Post a Comment