I have an array of div names, the div of which I would like to switch off on loading.
I read from both prototype api and another website that invoke is generally preferred if one is to do the same thing to each of the items in a list.
//I have this switch_off function
function switch_off(div){
Effect.SwitchOff(div);
}
//and this array
div_names = ['notice','status_bar','word_count']
//Please do tell me if this is not the best option:
div_names.invoke('switch_off');
But it doesn't work.
Is there another parameter I need to supply to invoke? Could it be this?
Added: Here's the Firebug output
//value[method] is undefined
//[Break on this error] return value[method].apply(value, args);
Thank You!