RobG <rg***@iinet.net.auau> writes:
function isDescendent(x, y){
while ( y = y.parentNode ) {
Just for safety, I recommend writing this as:
while ( (y = y.parentNode) ) {
just to make it explicit that you really mean an assignment and
not a comparison. Otherwise, it's just a matter of time before
some misguided coder puts this code into a
<script language="JavaScript1.2">...</script>
element and has it break in Mozilla ... because JavaScript version 1.2
actually "fixed" code like this to be a comparison.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'