old_contents: $(function(){
  	$(document).on('keydown', function(e){
          if ( e.which == 68 ){
      		$.ajax({
  	    		url: '/logData',
  		    	data: { json : JSON.stringify(data)} ,
  			    type: 'POST',
                  dataType : 'json', 
      			success: function(response){
  	    			console.log(response);
                      window.location.href="/startTrial";
  			    },
      			err: function(error){
  	    			console.log("shit");
  		        }
      		});
          }
  	});
  });
  
new_contents: $(function(){
  	$(document).on('keydown', function(e){
          if ( e.which == 68 ){
      		$.ajax({
  	    		url: '/logData',
  		    	data: { json : JSON.stringify(data)} ,
  			    type: 'POST',
                  dataType : 'json', 
      			success: function(response){
  	    			console.log(response);
                      window.location.href="/startTrial";
  			    },
      			err: function(error){
  	    			console.log("error");
  		        }
      		});
          }
  	});
  });
  
subject: Update final.js