|
-
Jun 28th, 2000, 03:08 AM
#1
Thread Starter
Frenzied Member
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>
-
Jun 28th, 2000, 04:38 PM
#2
Addicted Member
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
-
Jun 28th, 2000, 06:17 PM
#3
Thread Starter
Frenzied Member
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>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|