[Project_owners] Finding Href

Trevor Hobson trevorhemail-mozdev at yahoo.com.au
Mon Aug 27 15:49:44 PDT 2007


Greetings

Can I ask what you are trying to achieve?

If I understand correctly you have a node and you are trying to get the 
closest ancestor to that node that has a href attribute?

How are you determining what node to start at?

Trevor

joe ertaba wrote:
> hi
>
> i am using this code to find links href
>
> var target = e.target;
> while(target.href == undefined)
> target = target.parentNode;
>
> var href = target.href;
>
> it works good but it get error at line ( while(target.href == 
> undefined))  when target is not a link: Error: target has no properties
>
> any idea?
> ------------------------------------------------------------------------
>
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20070828/a2405162/attachment-0001.html 


More information about the Project_owners mailing list