Rich-text Reply

jQuery problem using height-function

CouchPsycho 10-29-15

jQuery problem using height-function

Hi,

 

within a test i plan to react on a changing window size. For any reason, a call like

 

alert($("#page").height());

results in an error message, saying that "height" is not a function....

 

I am confused. Any advice or hints?

 

Thanks in advance :-)




"the essence of the creative act is to see the familiar as strange." (anonymous)
Highlighted
MartijnSch 10-29-15
 

Re: jQuery problem using height-function

Hi,

Are you sure that jQuery is initialised? Because the height of a certain element is calculated through jQuery. If I try your current example on this page and use the body element instead of #page then it works completely fine with me.
Amanda 10-29-15
 

Re: jQuery problem using height-function

[ Edited ]

@MartijnSch is right, it sounds like a jQuery problem - 

 

Are you trying this in the editor? If so, are you using your own jquery? This might be why you see the error. 

 

Or, are you trying this in the JS console on the page itself? If that's the case, is jQuery on the page? Can you share the URL?

 

Check out @_DerekHammond 's bookmarklet suggestion here to load query on your page to test it out. 

Optimizely