title: Expressjs / Node.js - res.redirect() not loading page
body: <p>I have a page with a route <code>GET /team</code> which is loading a list of teams, and <code>DEL /team</code> which is deleting a team from <code>/team/:key</code>. So you navigate to a team's profile page and delete them from there, on deletion it should redirect you to the <code>/team</code> page. I have put logs into the console and it is successfully deleting the <code>team</code> and wierdly, it says it is loading <code>/team</code> but the browser does not load this. I have put my code below, any ideas?</p>
  
  <p>Routes:</p>
  
  <pre><code>  app.get('/team'/*, lim("Must be logged in to see teams")*/, getAllTeams, function(req, res){
      util.log('Serving request for url [GET] ' + req.route.path);
      // Pass it the list of all Teams
      res.render('team', {'teamsList' : req.teamsList} );
    });
  
    app.get('/team/:key', function(req, res) {
      util.log('Serving request for url [GET] ' + req.route.path);
      Team.findByKey(req.params.key, function(err, teamData){
        if(!err &amp;&amp; teamData){
          teamData = teamData;
          res.render('teamDetails', { 'teamData' : teamData } );
        } else {
          util.log('Error in fetching Team by key : ' + req.params.key);
          res.json({
            'retStatus' : 'failure',
            'msg' : 'Error in fetching Team by key ' + req.params.key
          });
        }
      });
    });
  
    /**
      * DEL /team/:key
      * Delete Team by key
      */
    app.del('/team/:key', getAllTeams, function(req, res) {
      util.log('Serving request for url [DEL] ' + req.route.path);    
      Team.remove({key : req.params.key}, function(err){
        var message = '';
        var retStatus = '';
        if (!err) {
          util.log('Successfully deleting Team with key: ' + req.params.key);
          message = 'Successfully deleting Team with key: ' + req.params.key;
          retStatus = 'Success';
          res.redirect('/team');
        } else {
          util.log('Error deleting Team with key: ' + req.params.key + 'Error: ' + util.inspect(err));
          res.json({
            'retStatus' : 'failure',
            'msg' : 'Error in fetching Team with key ' + req.params.key
          });
        }
      });
    });
  </code></pre>
  
  <p>JavaScript + HTML template:</p>
  
  <pre><code>        button#teamDelete.btn.btn-danger.btn-mini(type="submit", value="Delete Team") Delete
          script(type='text/javascript')
              $('#teamDelete').live('click',function(){ 
                  var teamId = #{teamData.key};
                  $.post('/team/' + teamId, { _method : 'delete' }, function(response) {
                      console.log(response);
                      if(response.retStatus === 'Success') {
                          if('/team' &amp;&amp; '/team' !== "") {
                              window.location = '/team';
                          }
                      }
                  });
              });
  </code></pre>
  
  <p>console logs:</p>
  
  <pre><code>10 Mar 11:52:01 - Serving request for url [GET] /team
  10 Mar 11:52:02 - Serving request for url [GET] /team/:key
  10 Mar 11:52:03 - Serving request for url [DEL] /team/:key
  10 Mar 11:52:03 - Successfully deleting Team with key: 1362855941128
  10 Mar 11:52:03 - Serving request for url [GET] /team
  </code></pre>
  
  <p>getAllTeams:</p>
  
  <pre><code>var getAllTeams = function(req, res, next){
    Team.getAll(function(err, teamsList){
      if(!err &amp;&amp; teamsList){
        req.teamsList = teamsList;
        return next();
      }
    });
  };
  </code></pre>
  
  <p>Team.getAll (Team schema)</p>
  
  <pre><code>Team.statics.getAll = function(cb){
      var query = this.find({});
      query.sort({key : -1});
      return query.exec(cb);
    };
  </code></pre>