Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Place 'random' into a script call
- From: javascript@xxxxxxxxxx (Colin Cochrane)
- Subject: [Javascript] Place 'random' into a script call
- Date: Wed, 29 May 2002 08:22:39 -0700
>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? Sure. <script LANGUAGE="JavaScript"> random = parseInt(Math.random()*1000) var url="http://64.41.103.143/cgi-bin/ad/k2fad.cgi?"+random+"+F=IMG"; alert(url); // alert just for testing purposes, use it wherever you need it. // ie window.location=url; </script> Hope this helps cdc Colin Cochrane Head Instructor Vancouver Film School New Media http://www.vfs.com/ Tel: (604) 685-6331 Ext 209 Fax: (604) 685-6308 Vancouver Film School. Creative. Disciplined. Focused.
- References:
- [Javascript] Place 'random' into a script call
- From: Greg Krieser
- [Javascript] Place 'random' into a script call
- Prev by Date: [Javascript] (no subject)
- Next by Date: [Javascript] How to start a java application?
- Previous by thread: [Javascript] Place 'random' into a script call
- Next by thread: [Javascript] unsuscribe
- Index(es):