oh, i thought it returned an array....
i guess because it worked with a for loop, and i figured that required an
array.



> Louis,
>
> document.getElementsByClassName returns a node list. You need to turn
> it into an array:
>
> var nodeList = document.getElementsByClassName('editView');
> var items = $A(nodeList);
>
> -Matt
>
>
> On Mar 16, 2006, at 1:04 PM, Louis Walch wrote:
>
>> can you please tell me why this is not working? i got the example
>> for how
>> to use each online and copied it to a t (except i added the if). its
>> telling me items.each does not exist.
>>
>> var items = document.getElementsByClassName('editView');
>>
>> if (items.length > 0){
>>      items.each(function (result){
>>              thisid = result.id;
>>              thiskey = thisid.replace(/se_item_/gi, '');
>>              selist_toggleEdit(thiskey,'display');
>>      });
>> }
>> _______________________________________________
>> Rails-spinoffs mailing list
>> Rails-spinoffs@lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to