title: JQuery $.ajax not bringing latest data
body: <p>I am using JQuery 1.7.2. I am using highchart for making live data chart.
  I maked one C# page where on the page load I am writing some jSON format data which I am using in another page with the help ajax call for highcharts. I will run that ajax call inside function and in success event of ajax call I will make setTimeout after 1 minute to call again function, So I will get latest data every time. Until here everything works very good.</p>
  
  <p>But I have issue lets say data I am getting data only for 4 hr at every 1 minute than I keep my browser open and come next day. That time my aspx page will start with new fresh data from zero, so my highcharts should automatically remove all points and should pushing new data but it is not doing that. When I refresh my page all will start working good. Is there anyway that it should refresh by itself</p>
  
  <p>My code for ajax call is as follow</p>
  
  <pre><code>    function recieveData() {
      var pathArray = window.location.pathname.split( '/' );
      var chart = $('#container').highcharts();
          $.ajax({
              url: '/' + pathArray[1] + '/HomePageChartData.aspx',
              dataType: 'json',
              cache: false,
              success: function (data) {
                chart.yAxis[0].setExtremes(data.minY, data.maxY, true, true);
                chart.series[1].setData([]);
                chart.series[1].name = data.lineSeriesName;
  
                chart.series[0].setData([]);
                chart.series[0].name = data.areaSeriesName;
  
                for (var x in data.lineSeriesData) {
                  chart.series[1].addPoint([data.lineSeriesData[x][0], data.lineSeriesData[x][1]]);
                }
  
                for (var x in data.areaSeriesData) {
                  chart.series[0].addPoint([data.areaSeriesData[x][0], data.areaSeriesData[x][1]]);
                }
                setTimeout(recieveData, 60000);
              }
            });
  }
  </code></pre>
  
  <p><strong>@@Edited with more explanation
  It's look like I could not properly previously so I will do it again. My scenario is like data come between 9 AM to 12.30 PM and it remain on the database until next day 7 AM. So my highchart will  get data every minute between 9 AM to 12.30 PM which is working very good without any problem. But issue when we wipe out all data at next day 7 AM and we start getting new data at 9 AM  my high chart is not clearing by itself and start getting new data.</strong></p>
  
  <p><strong>But if i refresh my browser I will get new data and it work good. So I was looking something like if we wipe all data my ajax should get alert and reload the page or clear data from highchart.</strong></p>
  
  <p><strong>So I was looking for some event or way to do it in ajax call. Some guidance from experts.</strong></p>