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: valdez38 Date: July 28, 2008 at 20:05:55 Pacific OS: Windows CPU/Ram: not sure Product: Dell
Comment:
I cannot get this code to work for me any suggestions? <script type="text/javascript"> var d = math.random(); if (d <= .04) { Window.open(“http://”,width=100%,height=100%); Window.focus(); } else if (d > .04 && d <= .08) { Window.open(“http://”,width=100%,height=100%); Window.focus(); } else if (d > .08 && d <= .12) { Window.open(“http://”,width=100%,height=100%); Window.focus(); } else { Window.open(“http://”,width=100%,height=100%); Window.focus(); } </script>
Summary: 1. Insert the following into the head of the document <script language="javascript"> var nameList = new Array (); nameList[0] = "Name1"; nameList[1] = "Name2"; nameList[2] = "Name3"; nameList[3] = ...
Summary: Hi, Not sure what you are trying to do exactly. Try changing the following to a number >=0 and < randombgs.length: Math.floor(Math.random()*randombgs.length) => e.g. document.write('<body style=...