Forum Moderators: open

Message Too Old, No Replies

Mistake with JavaScript

I tested but did not manage to put to work

         

romzinho2k7

4:09 am on Apr 27, 2006 (gmt 0)

10+ Year Member



Hey friends, all right?
I did a script to put "..." but one for a.

<html>
<title>TEST</title>
<script language="JavaScript" type="text/javascript">
function dopoints()
{
var wii=document.getElementById("dopoint").innerHTML;

if(wii=="&nbsp;&nbsp;&nbsp;")
document.getElementById("dopoint").innerHTML=".&nbsp;&nbsp;";
else if(wii==".&nbsp;&nbsp;")
document.getElementById("dopoint").innerHTML="..&nbsp;";
else if(wii=="..&nbsp;")
document.getElementById("dopoint").innerHTML="...";
else if(wii=="...")
document.getElementById("dopoint").innerHTML="&nbsp;&nbsp;&nbsp;";

window.setTimeout("dopoints()", 300);
}
</script>

<script language="javascript" type="text/javascript">dopoints();</script>
<p>Progress<span id="dopoint">&nbsp;&nbsp;&nbsp;</span></p>
</html>

That happens do not know where I was mistaken. Only look.
Could they help?

Moby_Dim

12:26 pm on Apr 27, 2006 (gmt 0)

10+ Year Member



Read this useful page : [quirksmode.org ], and try to solve the problem yourself (hope you'll understand the err cause ;)

mehh

10:31 am on May 1, 2006 (gmt 0)

10+ Year Member



You where trying to acsses something when it wasnt loaded yet. try this.

<html>
<head>
<title>TEST</title>
<script language="JavaScript" type="text/javascript">
function dopoints()
{
var wii=document.getElementById("dopoint").innerHTML;

if(wii=="&nbsp;&nbsp;&nbsp;")
document.getElementById("dopoint").innerHTML=".&nbsp;&nbsp;";
else if(wii==".&nbsp;&nbsp;")
document.getElementById("dopoint").innerHTML="..&nbsp;";
else if(wii=="..&nbsp;")
document.getElementById("dopoint").innerHTML="...";
else if(wii=="...")
document.getElementById("dopoint").innerHTML="&nbsp;&nbsp;&nbsp;";

window.setTimeout("dopoints()", 300);
}
</script>
<head>
<body onload="dopoints();">
<p>Progress<span id="dopoint">&nbsp;&nbsp;&nbsp;</span></p>
</body>
</html>