title: redirect to a jade file using javascript
body: <p>I would like to redirect to a file index.jade using javascript but it does not work with document.location.href = "index.jade", so how can i do ?
  this is what I did :</p>
  
  <p>SERVER:</p>
  
  <pre><code> app.get('/', function(req, res) {
          fs.readFile(__dirname + '/login.html', 'utf8', function(err, text){
              res.send(text);
          }); });    
      var io = require("socket.io").listen(server); 
      io.sockets.on('connection', function (socket) {   
      socket.on('login',function(data){
              console.log(data);
              socket.emit('redirect_to_chat1');
  
          });   
      });
  </code></pre>
  
  <p>CLIENT:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
  var socket = io.connect('http://localhost:8080');
  $('button#bd1').on({ click:function(e){
  socket.emit('login',{username:$('#login').val(),password:$('#pass').val()});
  socket.on('redirect_to_chat1', function(){
      document.location.href="index.jade";
  });
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>thx for all.</p>