[thelist] JS breakdown
jsWalter
jsWalter at torres.ws
Sat Jun 12 00:12:46 CDT 2004
> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org] On Behalf Of 7 sinz
> Sent: Friday, June 11, 2004 11:01 PM
> To: thelist at lists.evolt.org
> Subject: [thelist] JS breakdown
> can someone break this down for me.
>
> function rates() {
A function called RATES, with no parameters
> var find_rate
Local scope variable labeled FIND_RATE
> document.rate.country
- [document] Current document
- [rate] This is most likely a FORM Object ID or NAME
- [country] SELECT Object NAME or ID
> [document.rate.country.selected Index]
An index of that object.
Since it is a list, this is treated as an array.
So, this gives the INDEX value of the selected item
> .value;
What is the value of that selected item
> var find_rate2
Another locally scoped variable
> find_rate.split(",");
Now, take the value of the selected item form the COUNTRY select list
And split it on the COMMA into an array
Interesting. A select list that as 2 values for each item in the SELECT
list
> document.rate.Peak
> document.rate.OffPeak
This is most likely NAMEs or Ids of TEXT Objects or TEXTAREAs
> .value
This is that value of each text object
> document.rate.Peak.value=find_rate2[0];
This pulls the first element form the array and sticks it in PEAK text
object
> dcument.rate.OffPeak.value=find_rate2[1];
This pulls the second element form the array and sticks it in OffPeak
text object
Does that explain it?
Walter
More information about the thelist
mailing list