Need some help with javascript

Talk about and discuss various advancements and achievents in the arts and sciences of invention and modification; computers, sciences, mathematics, and technology for all.

0
No votes
 
Total votes: 0

gtsch
Posts: 17
Joined: Tue Jan 10, 2006 10:18 pm

Need some help with javascript

#1

Post by gtsch »

I'm been trying to design something for my website where you can put in a QB's stats, and then get the QB passer rating. I've tried a few times and failed badly do to my inexperience.

This is the formula, it's a little tricky.

C=completions
A=attempts
Y=yards
T=Touchdowns
I=interceptions

Rating =100/6 * [ (A/C-0.3)*5 + (Y/A - 3)/4 + (T/A) * 20 + (2.375 - 25*I/A) ]


The only catch is that all four of those parts have to be between 0 and 2.375
I'd appreciate any help that anyone can offer. Thanks.

BBcode:
Hide post links
Show post links
User avatar
AYHJA
392
Posts: 37990
Joined: Fri Sep 17, 2004 2:25 pm
Location: Washington, D.C.
Contact:

#2

Post by AYHJA »

As I mentioned, we can get raum to put this to Excel, and maybe me or WAI could put it to html or Java for you...Is this module to be embedded in a page, or shown as a pop-up..? Or maybe a linky link to the site so we can have a look..?

BBcode:
Hide post links
Show post links
gtsch
Posts: 17
Joined: Tue Jan 10, 2006 10:18 pm

#3

Post by gtsch »

Here's my site

http://www.ninercaphell.com

This is still in it's early stages, as I am learning on the job as far as how to build a site.

I was thinking like a pop up window if that's possible.

BBcode:
Hide post links
Show post links
User avatar
AYHJA
392
Posts: 37990
Joined: Fri Sep 17, 2004 2:25 pm
Location: Washington, D.C.
Contact:

#4

Post by AYHJA »

I'm thinking we can have you al fixed up by the end of this day...Assuming raum isn't saving the world via his global power ties, he should be able to hook this up...

That's a great looking site, heh...Didn't know you were a 49'ers fan...We're fighting now about who they're going to draft in teh sports section...

BBcode:
Hide post links
Show post links
User avatar
raum
Posts: 3944
Joined: Sun Jul 24, 2005 10:51 am

#5

Post by raum »

i can do this in excel blindfolded on my lunch break, but it seems to me that php would be far better for online apps...

but if you want to embed the excel object, i can do it at work. otherwise, i can't help right now.

personally, i would not make it a popup... i'd make it a embedded frame object, in your html table, or a roll-down flash-app, and have a "Passer Calc" (or whatever, and when you click it, it rolls down from the main menu tab.)

i hate pop-ups, so i am a bit biased.

lemme get this excel to you today, then you can just embed it, from your hosting package. good tuts on that everywhere.

Ch

BBcode:
Hide post links
Show post links
User avatar
AYHJA
392
Posts: 37990
Joined: Fri Sep 17, 2004 2:25 pm
Location: Washington, D.C.
Contact:

#6

Post by AYHJA »

Man is golden w/an Excel program, I swears...

BBcode:
Hide post links
Show post links
User avatar
raum
Posts: 3944
Joined: Sun Jul 24, 2005 10:51 am

#7

Post by raum »

ok, I got something in dev on this. the formula works fine, and I am just trying to build in integrity checks.

can one of you foozball fans please confirm ALL FOUR of these values must be between 0 and 2.375?

I was also thinking if you want room for more than one qb, and a cross comparison of stats? and if so, how many qb at once?

live to serve,
Ch

BBcode:
Hide post links
Show post links
User avatar
deepdiver32073
Iconoclast Extraordinaire
Posts: 8395
Joined: Tue Nov 02, 2004 4:25 pm

#8

Post by deepdiver32073 »

As a fan, I'd certainly want to be able to compare the stats of 2 or more QBs. As to the formula, I can't help you there. I've never known how they figured the QB rating. The formula looks interesting, but as far as the limitation to 2.375 and under... don't know.

BBcode:
Hide post links
Show post links
User avatar
AYHJA
392
Posts: 37990
Joined: Fri Sep 17, 2004 2:25 pm
Location: Washington, D.C.
Contact:

#9

Post by AYHJA »

Here are the stats of great USC Trojan QB Matt Leinhart... /:D" style="vertical-align:middle" emoid=":D" border="0" alt=":D" />

Completions - Attempts - Yards - Comp. % - YPA - Long - Touchdowns - Interceptions

283 431 3815 65.7 8.85 67 28 8

And next years Heisman Trophy Winner, Brady Quinn

292 450 3919 64.9 8.71 80 32 7

Now...Lets see if your new toy can calculate the correct ratings raumie...

BBcode:
Hide post links
Show post links
User avatar
raum
Posts: 3944
Joined: Sun Jul 24, 2005 10:51 am

#10

Post by raum »

alternately, you could just use this one:

http://www.primecomputing.com/

UPDATE: this sucks - the completion % is messed up.

BBcode:
Hide post links
Show post links
Post Reply