ik heb dus al een tijdje zitten prutsen (zie postingtijd
)
ik heb 2 javascriptjes door elkaar gemengd. Hij doet het bijna, maar hij loopt niet meer goed door. Iemand enig idee wat ik moet fixen?
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Example of the text writer script</title>
</head>
<body>
<script language="JavaScript">
<!--
var d
var i=6
var u=0
var time
var symbole
function tableau() {
this[0]="100|. You are out of luck";
this[1]="100|. Maybe some other time";
this[2]="100|. Not this time";
this[3]="100|. Come back later, I'm busy right now";
this[4]="100|. What can I say";
}
function scroll() {
var tb = new tableau()
time = tb[u].substring(0,3) // the substring command is so cool
symbole = tb[u].substring(3,5)
i++
if (i > tb[u].length) {
i = 6
u++
if (u > 5) { u = 0 } // 4 = line number -1
}
d = "<b>Sorry Mate.</b>"+tb[u].substring(5,i)
if(document.getElementById){
document.getElementById('msg').innerHTML=d+symbole;
} else if (document.all){
document.all['msg'].innerHTML = d+symbole
} else if (document.layers){
document.msg.document.write(d+symbole);
document.msg.document.close();
}
setTimeout ("scroll()",time);
}
// -->
</script>
<body onLoad="scroll(0)">
<div id="msg" style="font-size: 10px; font-family: Verdana, Georgia, Arial, Helvetica; border: 1px solid #000000; width: 300px; text-align: left;">
</div>
</form>
</body>
</html>
ik heb 2 javascriptjes door elkaar gemengd. Hij doet het bijna, maar hij loopt niet meer goed door. Iemand enig idee wat ik moet fixen?
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Example of the text writer script</title>
</head>
<body>
<script language="JavaScript">
<!--
var d
var i=6
var u=0
var time
var symbole
function tableau() {
this[0]="100|. You are out of luck";
this[1]="100|. Maybe some other time";
this[2]="100|. Not this time";
this[3]="100|. Come back later, I'm busy right now";
this[4]="100|. What can I say";
}
function scroll() {
var tb = new tableau()
time = tb[u].substring(0,3) // the substring command is so cool
symbole = tb[u].substring(3,5)
i++
if (i > tb[u].length) {
i = 6
u++
if (u > 5) { u = 0 } // 4 = line number -1
}
d = "<b>Sorry Mate.</b>"+tb[u].substring(5,i)
if(document.getElementById){
document.getElementById('msg').innerHTML=d+symbole;
} else if (document.all){
document.all['msg'].innerHTML = d+symbole
} else if (document.layers){
document.msg.document.write(d+symbole);
document.msg.document.close();
}
setTimeout ("scroll()",time);
}
// -->
</script>
<body onLoad="scroll(0)">
<div id="msg" style="font-size: 10px; font-family: Verdana, Georgia, Arial, Helvetica; border: 1px solid #000000; width: 300px; text-align: left;">
</div>
</form>
</body>
</html>