View Full Version : Variable in URL
optimum
10-18-2002, 05:51 PM
I want to put a random number on the end of my URL so that the cached page will not be displayed. The random number must be generated when the link is clicked.
http://home.earthlink.net/~optimum/clnt100test7.htm
Please help.
Thanks
RadarBob
10-18-2002, 07:07 PM
function RTFM () {
var theURL = "http://home.earthlink.net/~optimum/clnt100test7.htm"
var randy = Math.random();
theURL += randy; // will/should/maybe convert number to string.
}
randy will be a number between 0 and one. If you want to make it an integer between, say 0 - 1000, do this:
var randy =Math.random();
randy = randy*1000; // move decimal point over 3 digits
randy = Math.floor(randy); // truncates
You could write it all one big honkin' line if you want to.
optimum
10-18-2002, 09:19 PM
Thanks for the reply Radar Bob. Sorry for not being very clear.
Click on this link to see a partial page that I am working on.
http://home.earthlink.net/~optimum/clnt100test7.htm
When a URL is clicked on THAT page, I need to append a random number to it so I can get a refreshed page from the server.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.