[Javascript] Place 'random' into a script call

Greg Krieser greg at krieser.com
Tue May 28 22:26:06 CDT 2002


Is it possibe to use a number generated in one Javascript area and place it in another?  Here is what I'd like to do.  Across a site I'd like to call a perl script using this Javascript command.  That works fine and gives me the results I like. 

<script language="JavaScript" src="http://64.41.103.143/cgi-bin/ad/k2fad.cgi?999+F=IMG"></script>

However, I'd like 999 to be a random number each time the page is loaded, i.e. :

<script LANGUAGE="JavaScript"> 
random = parseInt(Math.random()*1000) 
</script>

Is it possible to use random in place of the 999 when the script is called?

Thanks,

Greg


P.S.  I'm attempting to adapt a banner script to allow flash ads as well as gif and jpg.  The beauty of using JavaScript is that a new random ad is displayed when visitors returns to the page or uses the back button.  Whereas other call methods (and therefore random methods) will simply return the cached image. 



More information about the Javascript mailing list