title: how to reload javascript file
body: <p>I have a question about reloading JavaScript files. I develop web pages front-ends and do a lot of coding in JS. Every time when I want to check an application's flow is correct (or do some debugging) I have to hit <kbd>F5</kbd> key to reload whole page and it's scripts, and I have to wait. Waiting time depends on page's weight and sometimes I get impatient. Therefore I wonder if there is any way to reload only changed script file <code>*.js</code>? or maybe there is some plugin for Chrome to reload chosen script? It could be a very handy way to ease development. Thank you for replies.</p>
  
  <p>this one uses jQuery, it is here for example:</p>
  
  <pre><code>var scs=$('script[type*=javascript]');
  var scsl = scs.length;
  var scsi = 0;
  var o = [];
  var oi = 0;
  var ol = 0;
  var s = '';
  var fws = 0;
  var sws = 0;
  var v = {};
  
  function i1(){
  fws = window.setInterval(function(){
          v = $(scs[scsi]);
          
          s = v.attr('src');
          if(typeof s!='undefined' &amp;&amp; s.indexOf('http')==-1 &amp;&amp; s.indexOf('index')==-1){
                  console.log([scsl,scsi,s]);
                  o.push({src:s});
                  v.remove();
          }
  
          if(scsi==scsl){
                  console.log(o);
                  window.clearInterval(fws);
                  ol = o.length;
  i2();
          }
          else{
                  scsi++;
          }
  },800);
  }
  
  function i2(){
                  sws=window.setInterval(function(){
                          v = o[oi];
                          sc = $('&lt;script&gt;').attr({type:'text/javascript',src:v.src+'?t='+(new Date().getTime())});
                          console.log([ol,oi,v.src]);
                          $('head').append(sc);
  
                          if(oi==ol-1){
                                  window.clearInterval(sws);
                          }
                          else{
                                  oi++;
                          }
                  },800);
  
  }
  i1();
  </code></pre>