GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Help with Java script (https://gfy.com/showthread.php?t=203778)

BlueFly 12-02-2003 06:49 AM

Help with Java script
 
I am trying to write a script to redirect traffic to a random url selected from a list of urls. So far, I have had no luck. :( I don't know a lot about writing scripts. Anyone have a good script for this? TIA

chemicaleyes 12-02-2003 06:53 AM

search some script sites, there are loads of free scripts that do that..

pudcat 12-02-2003 06:57 AM

haven't tested it though something like below should be fairly close to working.

sites=Array("url1","url2","....");
window.location=sites[math.round(math.random())*sites.length]

BlueFly 12-02-2003 06:57 AM

Quote:

Originally posted by chemicaleyes
search some script sites, there are loads of free scripts that do that..
I haven't had much luck there... I found one that was close, and butchered it up pretty bad. It did absolutely jak shit when I was done with it.

BlueFly 12-02-2003 07:01 AM

Quote:

Originally posted by pudcat
haven't tested it though something like below should be fairly close to working.

sites=Array("url1","url2","....");
window.location=sites[math.round(math.random())*sites.length]

That look promising... and a lot easier than what I was messing with. I will dicker with it. Thanks!

BlueFly 12-02-2003 07:13 AM

Quote:

Originally posted by BlueFly
That look promising... and a lot easier than what I was messing with. I will dicker with it. Thanks!
hmmmm, that one doesn't seem to work. :(

pudcat 12-02-2003 07:28 AM

sites[Math.round(Math.random()*(sites.length-1))]

BlueFly 12-02-2003 07:32 AM

Quote:

Originally posted by pudcat
sites[Math.round(Math.random()*(sites.length-1))]
That got it! Thanks for your help!


All times are GMT -7. The time now is 05:53 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123