Skip to content
Permalink
Browse files

Merge pull request #451 from scottjehl/master

Check body existence before referencing its properties (fixes Nokia error)
  • Loading branch information...
dmethvin committed Aug 4, 2011
2 parents 6a3395a + c8cc1b3 commit 1846551a0cbe346ea22f1630c555168ed7d45941
Showing with 3 additions and 2 deletions.
  1. +3 −2 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 ) {

0 comments on commit 1846551

Please sign in to comment.
You can’t perform that action at this time.