title: Jquery update variable through $.GET page
body: <pre><code>var p = 1;
  var flag = 0;
  $(window).scroll(function(){ 
      if(flag == 0){
          if($(window).scrollTop() == $(document).height() - $(window).height()){
              $.get('/fetchMore.php?page=' + p, function(data){});
                      p++
              }
      }
  });                        
  </code></pre>
  
  <p>I have a page, when scroll down, page will use $.get to fetch more data into it.</p>
  
  <p>in my fetchMore.php I have set up if no more data, $flag==1, I need out put javascript to update var flag, so scroll function will not fetch anymore</p>
  
  <p>My question is how to update var flag from fetMore.php page?</p>