title: javascript store image to array not working on chrome
body: <p>I'm trying to generate some images on a server, store them to an array in javascript and use them dynamically.</p>
  
  <p>I'm doing this by the following code snippet:</p>
  
  <pre><code>imageArray = new Array();
  for(var i=1; i&lt;=51; i++){
      imageArray[i] = new Image();
      if(i&lt;10){
          imageArray[i].src = "&lt;?php echo 'tmp/'.$_SESSION['token'].'/out';?&gt;0" + i + ".bmp";
      }else{
          imageArray[i].src = "&lt;?php echo 'tmp/'.$_SESSION['token'].'/out';?&gt;" + i + ".bmp";
      }
  }
  </code></pre>
  
  <p>Later I load them as background images in javascript.</p>
  
  <pre><code>for (var i = -3; i &lt;= 3; i++) {
      var img = $('#imgdiv' + i).get(0);
      if (imageArray[+i + +image0] != undefined) {
          img.style.backgroundImage = 'url(' + imageArray[+i + +image0].src + ')';
      } else {
          img.style.backgroundImage = '';
      }
  }
  </code></pre>
  
  <p>this is working in firefox, but in chrome every time I set the background image it is loading the image from the server.</p>
  
  <p>Is there another way to store them, because I'd like to delete them after the page has loaded?</p>