I am developing an application with node.js, express, couchDB and using nano to communicate with couch. I am using a jquery get request from client javascript. Using fiddler i can see that i get my view in the RAW result but the view is never rendered.
client:
$.get('employee/'+customerId, function(data){
return;
});
route:
app.get('/employee/:id', employee.viewEmployee);
viewEmployee:
exports.viewEmployee = function(req, res){
db.get(req.params['id'], { revs_info: false }, function(err, body, header) {
res.render('employee/single', {employee: body});
});
};
Everything works with no errors and i get the 'employee/single' view html in the raw response. my question is why the view is not rendered? why is the html just sent back in the raw and how can i get this to work?
Your $.get call is using a call back that isn't doing any thing.
from the jQuery api examples
Shows you how to do this.