Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Javascript: Math.random prob.
Name: mie2com Date: August 14, 2007 at 12:33:10 Pacific OS: XP CPU/Ram: Pentium 3 Product: Dell
Comment:
i'm trying to make this script alert random text based on random numbers. however, it keeps alert the same word. what is the prob. here's the script.
function test() { x = Math.floor(Math.random()*11); if (x=0) { alert("Below") } else if (x<5) { alert("Middle") } else { alert("Above") } } </script> [a href="javascript:void(0)" onclick="test()"]Click Me[/a]
Summary: I need to make a script that will randomly choose a background image from 4 different images when the page loads and displays it, everytime it reloads it will be a different image.I think I need to us...
Summary: Dear Michael J: These are the three java scripts which are in conflict: Numbaer 1) ---------- <script language="JavaScript1.2" type="text/javascript"> var slideshow_width='300px' //SET IMAGE WIDTH ...
Summary: hey, i have added the following javascript code to a page: +++++++++++++++++++++++++++++++++++++++++++ var answer = Math.floor(Math.random()*1000) var input = prompt("For security reasons, please ente...