Javascript question

Vickas

Member
Jul 18, 2001
150
0
0
Sorry bout this rather dumb q, but could someone tell me how to delay a javascript object from running?

ext = GetFileExtension(item.Path);
if (IsMovieFile(ext))
{
Preview.innerHTML = '<p>' +
'<object ID=MediaPlayer class=Movie classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">' +
'<param name="ShowDisplay" value=false>'+
'<param name="AutoPlay" value="false">' +
'</object>';
MediaPlayer.EnableContextMenu = false;
MediaPlayer.Open(item.Path);
}

Want it to open MediaPlayer after a delay of like 3 seconds. Or maybe even tell it to open the file 3 seconds after starting.

P.S. This is from the standard.htt file in Win2K, it keeps opening files in WMP b4 i get a chance to use it in a right click menu-item, and as a result the other prog can't open it whilst WMP has access.
 

Vickas

Member
Jul 18, 2001
150
0
0
hmmm, it's got some o those in the file already, in combo with a gTimer variable defined at the beginning at the file, usually in this context:

gTimer = window.setTimeout('Preview.innerHTML...etc....',1000);

little explanation plz?

I am def'ly the last person who should just be screwing around with javascripts (i need to take a course or sumthin....meh, too lazy :) )
just wanted to know what exactly the difference between setTimeout, window.setTimeout, and gTimer = .... is

hmmm, I'm not so sure, but setTimeout starts the function specified on it's own after the delay right?