joe ertaba aber hob zu reden an und schrieb:
> 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
You need to check that haven't passed the root node yet (whose
parentNode will be null) and you should use the "in" operator to check
for the href member instead of comparing against undefined:
var target = e.target;
while (target && !("href" in target))
target = target.parentNode;
var href = target ? target.href : "";
Karsten
--
Freiheit stirbt | Fsayannes SF&F-Bibliothek:
Mit Sicherheit | http://fsayanne.tprac.de/
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners