diff options
| author | Igor Minar | 2011-01-30 14:43:53 -0800 | 
|---|---|---|
| committer | Igor Minar | 2011-01-30 14:43:53 -0800 | 
| commit | f0fb4a3928971fb885f87bb5f25bb5a5c064e927 (patch) | |
| tree | c2224d00b6ccf891f4d95631b15da370f73a1355 /src | |
| parent | 0144fa1ca9c46e9bea17be5d9ffabf816bfa7a09 (diff) | |
| download | angular.js-f0fb4a3928971fb885f87bb5f25bb5a5c064e927.tar.bz2 | |
jqlite should not generate exceptions when accessing attributes on Document
Diffstat (limited to 'src')
| -rw-r--r-- | src/jqLite.js | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/src/jqLite.js b/src/jqLite.js index a59ba6c2..b607c095 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -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);      }    }, | 
