title: Uncaught SyntaxError: Unexpected token var Node.js
body: <p>I'm working with Node.js and trying to display a chart, generated out of coordinates from a txt file, which is uploaded to the server. 
  My problem: When I open the web page and upload the file, everything works perfectly, but the chart is not working: I get the following error: <em>UncaughtSyntaxError: Unexpected token var.</em> </p>
  
  <p>If I render the webpage without node.js everything works fine. </p>
  
  <p>The code:  </p>
  
  <pre><code>var express = require("express"); 
  var app = express();
  var fs = require('fs');  // we will need it for file uploads
  var port = process.env.PORT || 3000;
  
  app.configure(function(){
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(express.static(__dirname + '/public'));
  });
  
  app.get('/', function(req, res) {
  
       res.send('&lt;form method="post" enctype="multipart/form-data"&gt;'
      + '&lt;p&gt;Image: &lt;input type="file" name="uploadfile" /&gt;&lt;/p&gt;'
      + '&lt;p&gt;&lt;input type="submit" value="Upload" /&gt;&lt;/p&gt;'
      + '&lt;/form&gt;');
  
  });
  
  app.post('/', function(req, res){
  
      // .. Upload and file reading 
      // .. var obj[key1] (X-Values) and var obj[key2] (Y-Values) are generated 
      // .. 
                      res.send('&lt;head&gt;&lt;title&gt;Line Chart&lt;/title&gt;&lt;script src="../Chart.js"&gt;&lt;/script&gt;&lt;meta name = "viewport" content = "initial-scale = 1, user-scalable = no"&gt;&lt;style&gt;canvas{    }&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;canvas id="canvas" height="450" width="600"&gt;&lt;/canvas&gt;'
                      +'&lt;script type="text/javascript"&gt;'  
                      +' ' 
                      +'var lineChartData = { ' 
                      +'labels : [ ' + obj[key1] + ' ],' 
                      +'datasets : [{' 
                      +'fillColor : "rgba(151,187,205,0.5)",' 
                      +'strokeColor : "rgba(0, 0, 0, 0.831373)",' 
                      +'pointColor : "rgba(151,187,205,1)",' 
                      +'pointStrokeColor : "gba(76, 255, 178, 0.831373)",' 
                      +'data : ['+ obj[key2] + ' ]' 
                      +'} ] } '  
                      +'var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Line(lineChartData);' 
                      +'&lt;/script&gt;'
                      +'&lt;/body&gt;&lt;/html&gt;'
                      );
              };
          });
  
       });        
  });
  
  app.listen(port, function() {
    console.log("Listening on " + port);
  });
  </code></pre>
  
  <p>I hope you can help me.. </p>
  
  <p>Greetings, </p>
  
  <p>JS </p>