i tried both solutions and both did not work....
var items = document.getElementsByClassName('editView');
if (items.length > 0){
$A(items).each(function (result){
//blah blah
});
}
ERROR: (items).each is not a function
var items = $A(document.getElementsByClassName('editView'));
if (items.length > 0){
items.each(function (result){
//blah blah
});
}
ERROR: items.each is not a function
> 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
>> [email protected]
>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
> _______________________________________________
> Rails-spinoffs mailing list
> [email protected]
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs