Erreur dans un script relativement simple ?
Bonjour,
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
<script language="javascript">
function CreateRandomChars() {
var RandomChars=""
var Chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
while(RandomChars.length!=15) {
RandomChars+=Chars.charAt(Math.round(Math.random()*Chars.length))
}
return RandomChars
}
function DynamicAppearingText(text,ident,delay) {
i = 0;
this.Identification = CreateRandomChars()
document.write('<span id="'+this.Identification+'"></span>')
this.Show = function () {
eval("document.getElementById('"+this.Identification+"').style.visibility='visible'")
}
}
a = new DynamicAppearingText("hi","test")
alert(a.Identification)
a.Show()
</script> |
Pourriez-vous me dire pourquoi j'obtiens l'erreur "Line 18 Char 1 : Object Required" ?
Merci