Webmaster Forum Rules | Posting Guide | Contact Us | Testimonials | Contributing Geek Program | Advertise on Geek/Talk
Welcome to the GeekTalk Webmaster Discussion Forums from GeekVillage.com

Click Here To Register. It's Free!

Go Back   geek/talk: Signature-free discourse for serious web publishers > YOUR CREATION: Building & Maintaining A Web Site > Web Design and Webmaster Issues
User Name
Password
Register FAQ Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 04-09-2001, 08:43 PM   #1
cybmike
-Member
 
Join Date: Mar 2001
Posts: 81
Unhappy javascript question

I need some code that will make a user vote for my site when they enter my site, but it has to draw from a list of sites. Like 30% of the hits will go to site A, and 30% will go to site B, etc etc.
cybmike is offline   Reply With Quote
Old 04-10-2001, 11:37 PM   #2
FreeArcade
I am a Contributing Geek. Are You?
 
FreeArcade's Avatar
 
Join Date: Feb 2001
Location: Tecumseh, MI USA
Posts: 76
Unhappy

If you don't care which user goes where, just that percentages go to different sites then you could
generate a random number when the user enters the page. then branch to different sections of your javascript based on what the number was.

Quote:
Originally posted by cybmike:
I need some code that will make a user vote for my site when they enter my site, but it has to draw from a list of sites. Like 30% of the hits will go to site A, and 30% will go to site B, etc etc.
FreeArcade is offline   Reply With Quote
Old 04-10-2001, 01:06 PM   #3
cybmike
-Member
 
Join Date: Mar 2001
Posts: 81
Unhappy

Ok, where can I get this wonderful code?
cybmike is offline   Reply With Quote
Old 04-10-2001, 01:25 PM   #4
T Dot
Registered User
 
Join Date: Aug 2000
Location: Canada
Posts: 197
Arrow

<script language="JavaScript">
var nr_of_links = 2;
var lnk = new Array (nr_of_links)
var desc = new Array (nr_of_links)
var dsp = new Array (nr_of_links)
lnk[0] = "01.html";
lnk[1] = "http://www.link2.com";
lnk[2] = "http://www.link3.com";

desc[0] = "PIC";
desc[1] = "PIC";
desc[2] = "PIC";

dsp[0] = "";
dsp[1] = "";
dsp[2] = "";

var hits = 0;
while (hits < (nr_of_links + 1))
{
rnd = Math.round(Math.random() * nr_of_links)
if (dsp[rnd] == "")
{
dsp[rnd] = lnk[rnd]
hits += 1
document.write('<a href="' + lnk[rnd] + '" target="_blank">' + desc[rnd] + '</a> ')
**
**
//-->
</script>

This might help...
T Dot is offline   Reply With Quote
Old 04-10-2001, 02:13 PM   #5
cybmike
-Member
 
Join Date: Mar 2001
Posts: 81
Unhappy

I need that in a popup form http://geekvillage.com/ubb/smile.gif You know like when you enter a site you get dialog box saying ok/cancel and if you hit ok you enter my site and the voting gateway.
cybmike is offline   Reply With Quote
Old 04-10-2001, 02:55 PM   #6
T Dot
Registered User
 
Join Date: Aug 2000
Location: Canada
Posts: 197
Arrow

try

24fun.com
T Dot is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick Javascript menu question DJ_B Web Design and Webmaster Issues 0 06-08-2006 11:45 PM
Pop-up Javascript question - please help 1lit Web Design and Webmaster Issues 0 05-21-2001 12:50 PM
pop up javascript site and question singloon Web Design and Webmaster Issues 5 07-12-2000 12:20 AM
ADMIN: VIP geek/chat transcripts for 5/20/00. READ ME! Steve_S Marketing Your Website Online 0 05-21-2000 12:11 PM
Javascript Question kris Web Design and Webmaster Issues 1 10-13-1999 10:06 PM

Please support our advertisers. They ensure our survival.

All times are GMT -5. The time now is 01:45 AM.


GeekVillage.com is copyright © 1998-2015 Curiosity Cave - Science gifts for clever kids. All rights reserved.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.