JavaScript: How to preload <object> image data? / JavaScript's Image vs. <object>
<p>I'm developing a web app at the moment, and, being a perfectionist, I try to make it all shiny and compliant with all the standards. As far as I know, the <code>&lt;img&gt;</code> tag is to be deprecated in the upcoming standards for xHTML, and as nowadays even IE is able to handle <code>&lt;object&gt;</code> properly, I wanted to use the <code>&lt;object&gt;</code> tag for all the images on my site.</p>

<p>Now, I need to preload some of my images for standard <code>onmouseover</code> swapping. It was no problem with <code>&lt;img&gt;</code>:</p>

<pre><code>var rateImagesURLs = new Array("images/mark0.png", "images/mark1.png");
var rateImages = new Array(rateImagesURLs.length);

for (var i=0;i&lt;rateImagesURLs.length;++i) {
    rateImages[i] = new Image();
    rateImages[i].src = rateImagesURLs[i];
}
</code></pre>

<p>but I can't get it to work with <code>&lt;object&gt;</code>. I just can't find a way to connect JavaScript's <code>Image</code> object to actual <code>&lt;object&gt;</code> tag. I tried playing with <code>&lt;object&gt;</code>'s <code>data</code>, as well as <code>archive</code> attribute, but even the guys at W3C seem to be unsure as to how to use it, suggesting in their documents separating values with spaces in one place, and then commas a few paragraphs below... So my question is: how do I preload images in JavaScript using <code>&lt;object&gt;</code> tag?</p>

<p>P.S. Sorry for lengthy intro for rather simple question.</p>
