title: Live float from serverside into javascript
body: <p>I'm currently stuck in a project.</p>
  
  <p>I have this javascript graph, which updates the data every second. Thing is, I would that data to be the latest variable from my serverside, or the latest rows in a database.</p>
  
  <p>My current code looks like this.</p>
  
  <pre><code>events: {
      load: function () {
  
          // set up the updating of the chart each second
  
          var series = this.series[0];
          setInterval(function () {
  
              var x = (new Date()).getTime(), // current time
              y = &lt;%= serverVar%&gt;
              series.addPoint([x, y], true, true);
  
          }, 1000);
      }
  }
  </code></pre>
  
  <p>Or at least, the relevant part. This is where the graph updates every second. But even though y is set to a serverside variable, it does not get the latest? </p>
  
  <p>What have I done wrong?</p>
  
  <p>The serverside language is ASP.net (C#)</p>