-
Fixed!
next please!
Code:
<HTML>
<HEAD>
<TITLE>Timer Function Example</TITLE>
<script langauge="JavaScript"> <!-- hide me
function alertIn2Secs()
{
the_timeout = setTimeout("document.writeln('Hello');", 2000);
}
// show me -->
</script>
</HEAD>
<BODY OnLoad="alertIn2Secs()">
</BODY>
</HTML>
-
Thanks mark,
can you tell me is it possible to do the following or is my syntax incorrect again ?
<HTML>
<HEAD>
<TITLE>Timer Function Example</TITLE>
<script langauge="JavaScript">
<!-- hide me
var string1 = Hello"
var string2 = "World"
function alert1()
{
the_timeout = setTimeout("document.writeln(string1)", 1000); ("document.writeln(string2)", 2000);
}
// show me -->
</script>
</HEAD>
<BODY OnLoad="alert1()">
</BODY>
</HTML>
nmretd
-
the document.write() function overwrites what is already there
you can use alert()s though
Code:
<HTML>
<HEAD>
<TITLE>Timer Function Example</TITLE>
<script langauge="JavaScript">
<!-- hide me
var string1 = "Hello";
var string2 = "World";
function alert1()
{
setTimeout("alert(string1)", 1000);
setTimeout("alert(string2)", 2000);
}
// show me -->
</script>
</HEAD>
<BODY onload="alert1()">
</BODY>
</HTML>