javascript - Undefined Type Error "defaultView" with basic jQuery -


I'm just trying to create original resizing script using raw jQuery v1.5.1 (script below). For some reasons, it throws the following error and does not continue with running the script.

This Chrome, Mac OSX

error is being tested with unchecked type error: the property can not be read undefined of 'defaultView'

code:

  $ (document) .ready (function () {/ * set initial width of the site * / stretch_portal_content (); $ (Window). Reset (stretch_portal_content);}); Function stretch_portal_content () {warning ($ ('# site'). Width ()); $ ('#left-container') width ($ ('# site'). Width () - 150); If ($ (window) .height ()> $ ('body'). InnerHeight ()) {$ ('# site') height ($ (window). WinnerHeight ()); }}   

Example HTML

  & lt ;! DOCTYPE html5 & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; Link media = "screen" rel = "stylesheet" href = "style.css" /> & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "site" & gt; & Lt; Div id = "left-container" & gt; & Lt; Div class = "inner" & gt; & Lt; Ul id = "grid" & gt; & Lt; Li & gt; Story 1 & lt; / Li & gt; & Lt; Li & gt; Story 2 & lt; / Li & gt; & Lt; Li & gt; Story 3 & lt; / Li & gt; & Lt; Li & gt; Story 4 & lt; / Li & gt; & Lt; Li & gt; Story 5 & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div id = "right-container" & gt; & Lt; Ul id = "class-list" & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Category 1 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Category 2 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Category 3 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Category 4 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Category 5 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Category 6 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Category 7 & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; Div class = "clear" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Script type = "text / javascript" src = "javascript / jquery.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "javascript / core.js" & gt; & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;    

The problem is not applicable to the inner hight function window object Use height instead

Comments