aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-08-04 14:35:29 -0700
committerDave Methvin <dave.methvin@gmail.com>2011-08-04 14:35:29 -0700
commit1846551a0cbe346ea22f1630c555168ed7d45941 (patch)
tree1e2a4ecfc8b4c942c6d8180c15ca7b8f10cb0922
parent6a3395afcdb958a25f9a7cba3e544fe10d4d123a (diff)
parentc8cc1b35e400ef125597dfa7d84ee63553f6501d (diff)
downloadjquery-1846551a0cbe346ea22f1630c555168ed7d45941.tar.gz
jquery-1846551a0cbe346ea22f1630c555168ed7d45941.zip
Merge pull request #451 from scottjehl/master
Check body existence before referencing its properties (fixes Nokia error)
-rw-r--r--src/dimensions.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dimensions.js b/src/dimensions.js
index 88fa17506..d54776536 100644
--- a/src/dimensions.js
+++ b/src/dimensions.js
@@ -38,9 +38,10 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
if ( jQuery.isWindow( elem ) ) {
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
- var docElemProp = elem.document.documentElement[ "client" + name ];
+ var docElemProp = elem.document.documentElement[ "client" + name ],
+ body = elem.document.body;
return elem.document.compatMode === "CSS1Compat" && docElemProp ||
- elem.document.body[ "client" + name ] || docElemProp;
+ body && body[ "client" + name ] || docElemProp;
// Get document width or height
} else if ( elem.nodeType === 9 ) {