Ticket 1591 - IE $('table').attr('non-existent) "Invalid Argument" Error
<div><a href="http://dev.jquery.com/ticket/1591">
http://dev.jquery.com/ticket/1591</a>
IE throws an "Invalid Argument" error when attempting to get an attribute on a table element when the attribute doesn't exist. Fix below (and also in ticket)
Around Line: 860
if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) )
return elem.getAttribute( name, 2 );
</div>
<div>FIX:</div>
<div>// Fixes a getAttribute 'Invalid Exception' error when getting an attribute on a
// table element when the attribute does not exist
// <a href="http://www.andrewdupont.net/2007/01/10/code-hasattribute-for-ie/">
http://www.andrewdupont.net/2007/01/10/code-hasattribute-for-ie/</a>
if ( jQuery.browser.msie ) {
if ( /href|src/.test(name) && !jQuery.isXMLDoc(elem) )
return elem.getAttribute( name, 2 );
return ( elem.attributes[name] != undefined ? elem.getAttribute(name) : undefined );
}
</div>
<div> </div>
<div>Cheers,</div>
<div>-js</div>