title: JS function to preload images before page load
body: <p>I need a javascript code which loads an image into browser cache. What is the usage? read this: </p>
  
  <p>When the user logs into my site, she/he gets redirected to a page which is "Redirecting you to control panel" and a progress is displayed there too. Now, this "redirector" page has a background, since user experience this page and sees it only 3 seconds, many times, background image is missed and there remains no chance for it to be loaded, since from the page load till the page redirection there is only 3 seconds gap. Here is en example of my ajax login:</p>
  
  <pre><code>$.ajax({
  // do ajax stuff
  success : function(msg)
  {
    if(msg==true)
  {
     // I NEED A FUNCTION HERE TO LOAD THEM IMAGE INTO CACHE BEFORE THIS PAGE 
     // TO LOAD THE REDIRECTOR PAGE. USING THIS, I CAN ENSURE THE EXISTENCE OF THE
     // BG IMAGE WHEN THE USER SEES NEXT PAGE. THIS BG IMAGE IS INDEED NEXT PAGE'S BG
     window.locatio.href = 'process/redirection/to/user-panel';
  }
  }
  });
  </code></pre>