On Wed, Feb 11, 2009 at 12:18 PM, Daiv Mowbray <[email protected]> wrote:
>
> Hello nwhite,
>
> Thanx for the reply and suggestions.
>
> I have applied some of them and now I have this:
> function clear_link(){
> var unlinked = 0;
> mysplit = window.location.href.split('#')[0];
> a = $('#mydiv').getElements('a');
> for(var i=0;i<a.length;i++)
> if(a[i].href == mysplit){
> a[i].destroy(); // instead of
> removeNode(a[i]);
> var unlinked = 1;
> }
> if (unlinked == 0){
> var newHit = a[0];
>
> newHit.parentNode.setProperty('id','active_nav');
> }
> }
>
> But I am receiving the following error, any thoughts?
> $("#mydiv") is null
> [Break on this error] a = $('#mydiv').getElements('a');
In mootools, we do
$('mydiv') or $$('#mydiv') ... in the first case, you will get a
single Element and in the second, an array containing a single element
So the line is better written as:
$('mydiv').getElements('a');
Regards
Rajeev J Sebastian