Show table until object is downloaded (how do I)

Hey, I have a page that is showing QTVR (.mov, which Javascript
doesn't treat much differently than a large image). Since these are a
little slow to download, I'm trying to figure out a good way to show a
table in it's place until it's totally downloaded.

I'm currently using the following code, but it immediately overwrites
the table before the .mov is downloaded. This makes the page a little
confusing for about 15 seconds. Ideally, the table would be shown
until the .mov is completely ready to play. Then, once someone clicks
on a different movie, the "please wait" table would be shown again
until the second movie is downloaded, and so on.

Here's the original code, simplified for posting:

function viewTour(source) {
document.getElementById("tour").innerHTML = "<embed src='" + source +
".mov' height='240' width='320' border='0' controller='true'>"

<body onLoad="viewTour('0')">

<div id="tour">
<table width="320" height="240" border="1"><tr><td>
Please wait...

<a href="#" onClick="viewTour('0'); return false">
Click to see first movie

<a href="#" onClick="viewTour('1'); return false">
Click to see second movie

<a href="#" onClick="viewTour('2'); return false">
Click to see third movie

Any suggestions would be greatly appreciated! TIA,

6/28/2003 4:30:53 AM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

0 Replies

Similar Articles

[PageSpeed] 0