console reports conditional statements issues
| Project: | Color Animations |
| Version: | 1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
hi!
i'm using the color plugin, and the console reports a few warnings, all
related to conditional statements.
As little i know about javascript, it appears to me this as incorrect coding
but i must be wrong since it was coded by John Resig and recently patched by Karl :)
function getColor(elem, attr) {
var color;
do {
color = jQuery.curCSS(elem, attr);
// Keep going until we find an element that has color, or we hit
the body
if ( color != '' && color != 'transparent' || jQuery.nodeName(elem,
"body") )
break;
attr = "backgroundColor";
* } while ( elem = elem.parentNode );*
return getRGB(color);
};
shouldn't it actually be
* } while ( elem == elem.parentNode );*
For that plugin, the console gives me more warnings for all lines like this
one:
if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
return colors['transparent']
shouldn't it be:
if (result *==* /rgba\(0, 0, 0, 0\)/.exec(color))
return colors['transparent']
So, am i wrong this is incorrect coding ?
