I'm writing a simple web application using Nodejs, Express, and Jade. I've set up my routes appropriately. I'm having a problem with navigating between views. I am able to change views by entering the appropriate url in my browser. How can I get my application to change views on button click? I realize this may stem from a fundamental misunderstanding of the technologies I'm using.
Currently, I am trying to hit my controller via jquery ajax
$('#submit').click(function(){
$.ajax({
url: "/go",
data: "site=" + $('#website').val() + "&img=" + $('#image').val()
});
});
This successfully hits my controller:
app.get('/go', function(req, res){
res.render('view', {title: 'create', site: req.query['site'] });
This returns the proper html, however it does not get rendered as a new view.