title: why does this piece of js throw a DOM Exception?
body: <p>I can't figure out why this <a href="http://jsfiddle.net/bevacqua/kDtQb/" rel="nofollow"><strong>fiddle</strong></a> throws </p>
  
  <blockquote>
    <p>Uncaught Error: InvalidStateError: DOM Exception 11 </p>
  </blockquote>
  
  <pre><code>function url(){
   return '/echo/js/?js=' + 5 + Math.floor(Math.random()*900);
  }
  
  function poll(done){
      var xhr = new XMLHttpRequest();
      xhr.onreadystatechange = function(){
          if(xhr.status === 200 &amp;&amp; xhr.readyState === 4){
              var foo = xhr.responseText;
              done(parseInt(foo));
          }
      };
      xhr.open('get',url(),false);
      xhr.send(null);
  }
  
  var button = document.querySelector('#poller');
  var price = document.querySelector('#price');
  
  button.addEventListener('click', function(){
      poll(function(data){
          price.innerText = data;
      });
  },false);
  </code></pre>