Click to See Complete Forum and Search --> : Need javacript for league use


webbaron
02-13-2003, 11:31 AM
Hi all

Need to find a editable javascript that I could use for a league page that would update a players stats and predictions.

Any ideas?

Thanks for your help

AdamBrill
02-13-2003, 11:48 AM
How many players? You could probably just make an array to hold all of the players and their data... Like this:

<script language=javascript>
Players = new Array();
Players[0] = new Object();
Players[0].name="Bob";
Players[0].hits=4;
Players[1] = new Object();
Players[1].name="Jim";
Players[1].hits=2;
Players[2] = new Object();
Players[2].name="Jack";
Players[2].hits=7;
Players[3] = new Object();
Players[3].name="Alex";
Players[3].hits=12;
</script>

I don't know if something like that will work for you or not, but it might be worth trying...

webbaron
02-13-2003, 11:51 AM
League consists of about 30 players.

Will be over 50 choices for predictions.

Trying to work this so predictions and stats are updated auto on a mainpage and on each individual players page.

I'm a little new to editing javascript but can figure it out with a bit of help.

Thanks

AdamBrill
02-13-2003, 11:57 AM
How often are these going to be changing? What I would do is upload a Players.js that holds all of the data, then you can just call and reference it from any of the pages. Let me know if you need some help with that...

webbaron
02-13-2003, 12:32 PM
That's quite a script. I did a quick search and found one to take a look at.

Basically, would be updated when each player makes his prediction. Then stats updated say once a week to update each player on a mainpage and each individual player page.

Stats would be determined by a pts system something like auto racing uses.

Head starting to hurt now. :)

AdamBrill
02-13-2003, 08:00 PM
Here are some files that should help you. They load all of the Players and their number of hits into the table. Let me know if you have any more questions. I'd be happy to help... If you want, you could e-mail me at adam@code4ever.com