Random script doesn`t work
2 posters
Page 1 of 1
Random script doesn`t work
Hello!
Can someone, please, tell me, what is worng with my script for random text? I put it on a portal, but it just didn`t work.
Thank you.
Can someone, please, tell me, what is worng with my script for random text? I put it on a portal, but it just didn`t work.
- Code:
SCRIPT>joke0= "joke here";joke1= "joke here";joke2= "joke here";joke3= "joke here";var ran_unrounded=Math.random()*3;var ran_number=Math.round(ran_unrounded);document.write(eval("joke"+ran_number));</SCRIPT>
Thank you.
Mateja- Forumember
- Posts : 96
Reputation : 0
Language : English, Espanol, Detusch
Re: Random script doesn`t work
It should work though, but here are two possible sources of trouble:
the initial tag is not complete, be sure you have written "<script>" instead of just "script>". Also, note that you have all options named "joke here", even if it chooses a random one, you might not notice a difference.
the initial tag is not complete, be sure you have written "<script>" instead of just "script>". Also, note that you have all options named "joke here", even if it chooses a random one, you might not notice a difference.
zakir321- New Member
- Posts : 0
Reputation : 2
Language : english
Re: Random script doesn`t work
Acctually I have written <script> (made a mastek when I was copied & pasted).
I`ve also already used different names of options so this isn`t the problem..
What can be possibly wrong?
I`ve also already used different names of options so this isn`t the problem..
What can be possibly wrong?
Mateja- Forumember
- Posts : 96
Reputation : 0
Language : English, Espanol, Detusch
Similar topics
» script doesnt work anymore.
» HELP: Preload, tabcontent, tooltip script doesnt work on my forum!
» JavaScript doesnt work
» Adding Events On Calender
» IMG doesnt work
» HELP: Preload, tabcontent, tooltip script doesnt work on my forum!
» JavaScript doesnt work
» Adding Events On Calender
» IMG doesnt work
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum