jqlite should not generate exceptions when accessing attributes on Document

This commit is contained in:
Igor Minar 2011-01-30 14:43:53 -08:00
parent 0144fa1ca9
commit f0fb4a3928

View file

@ -206,8 +206,9 @@ JQLite.prototype = {
} else if (isDefined(value)) {
e.setAttribute(name, value);
} else {
// the extra argument is to get the right thing for a.href in IE, see jQuery code
return e.getAttribute(name, 2);
// the extra argument "2" is to get the right thing for a.href in IE, see jQuery code
// some elements (e.g. Document) don't have get attribute, so return undefined
if (e.getAttribute) return e.getAttribute(name, 2);
}
},