Jump to content
  • 0

Как отложить выполнение срипта?


Wol11
 Share

Question

Привет всем. Есть код:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body bgcolor="#000000">
<script language="javascript" type="text/javascript">
document.writeln('<div align="center" style="margin-top: 70px;">');
document.writeln('<object>');
document.writeln('<embed src="Metallica - The Unforgiven.mpg" type="application/x-mplayer2" autostart="true" showcontrols="0"></embed>');
document.writeln('</object>');
document.writeln('</div>');
</script>
</body>
</html>

Как сделать, чтобы выполнение скрипта началось секунд через 20 после загрузки страницы?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body bgcolor="#000000">

<div align="center" style="margin-top: 70px;" id="some_conteiner"></div>

<script language="javascript" type="text/javascript">

function onload_writethis()
{
document.getElementById('some_conteiner').innerHTML = '<object>'+
'<embed src="Metallica - The Unforgiven.mpg" type="application/x-mplayer2" autostart="true" showcontrols="0"></embed>'+
'</object>';
}

window.onload = new function()
{
setTimeout('onload_writethis()', 20000);
}
</script>
</body>
</html>

помойму так...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy