Hi all,
First of all I am fairly new to javascript. Most of my experience has
been with
its subset vrmlscript, so have mercy.
The following script works in I.E. 5.5, but hangs up in Netscape 4.8
(also works in vrmlscript for blaxxun Contact vrml plugin)
The general idea is to make Math.random() more "random" by calling it
x number
of times. X would would be decimal places taken from a time stamp, but
in this simplified example it is just 75.
Any ideas on how to keep it from hanging in Netscape?
thanx
Russ Kinter
<HTML>
<HEAD>
<SCRIPT language='Javas cript1.2'>
function count(a){
var c = 0;
var d = new Array;
with (Math){
for(var b = 0;b<=a;b++){ d[b] = random();
if(b==a){c = round(77*d[b]);}}}
document.writel n(c);}
</SCRIPT >
</HEAD>
<BODY>
<H2>Example</H2>
<FORM>
<INPUT TYPE="button" NAME="Example" onClick="count( 75)">
</FORM>
</BODY>
</HTML>
First of all I am fairly new to javascript. Most of my experience has
been with
its subset vrmlscript, so have mercy.
The following script works in I.E. 5.5, but hangs up in Netscape 4.8
(also works in vrmlscript for blaxxun Contact vrml plugin)
The general idea is to make Math.random() more "random" by calling it
x number
of times. X would would be decimal places taken from a time stamp, but
in this simplified example it is just 75.
Any ideas on how to keep it from hanging in Netscape?
thanx
Russ Kinter
<HTML>
<HEAD>
<SCRIPT language='Javas cript1.2'>
function count(a){
var c = 0;
var d = new Array;
with (Math){
for(var b = 0;b<=a;b++){ d[b] = random();
if(b==a){c = round(77*d[b]);}}}
document.writel n(c);}
</SCRIPT >
</HEAD>
<BODY>
<H2>Example</H2>
<FORM>
<INPUT TYPE="button" NAME="Example" onClick="count( 75)">
</FORM>
</BODY>
</HTML>
Comment