title: how to load jade file in node.js after making Ajax call
body: <p>In my node.js application i am making an Ajax class on a button click and i want to load the new html file. Everything is happening great but the new html file is not getting loaded.</p>
  
  <p>I am making ajax call like this in main.jade file:</p>
  
  <pre><code>script(type='text/javascript').
              $(document).ready(function(){
                  $(".login-button").click(function() {
                    $.ajax({
                      method: "POST",
                      url: "http://localhost:3000/admin",
                      data: { name: "xyz", organization: "abcdz" }
                    })
  
  router.post('/admin', function(req, res) {
      res.render('summary', { name: req.body.name})
  });
  </code></pre>
  
  <p>After making ajax call on click of login button i want to load summary.jade file but it's not getting loaded instead its showing login page.</p>
  
  <p>I am not getting the idea how to do this.</p>
  
  <blockquote>
    <p>app.js</p>
  </blockquote>
  
  <pre><code>var express = require('express');
  var path = require('path');
  var favicon = require('serve-favicon');
  var logger = require('morgan');
  var cookieParser = require('cookie-parser');
  var bodyParser = require('body-parser');
  
  var routes = require('./routes/index');
  var users = require('./routes/users');
  
  var app = express();
  
  // view engine setup
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'jade');
  
  // uncomment after placing your favicon in /public
  //app.use(favicon(__dirname + '/public/favicon.ico'));
  app.use(logger('dev'));
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(cookieParser());
  app.use(express.static(path.join(__dirname, 'public')));
  
  app.use('/', routes);
  app.use('/users', users);
  </code></pre>