[Project_owners] Finding Href

Michael Vincent van Rantwijk, MultiZilla mv_van_rantwijk at yahoo.com
Mon Aug 27 14:04:42 PDT 2007


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?

I would check my targets for HTMLLinkElement and HTMLAnchorElement 
because that's what you want them to be, right?

-- 
Michael Vincent van Rantwijk
- MultiZilla Project Team Lead
- XUL Boot Camp Staff member (ActiveState Training Partner)
- iPhone Application Developer



More information about the Project_owners mailing list