How do I determine scrollHeight?
scrollHeight
is a regular javascript property so you don't need jQuery.
var test = document.getElementById("foo").scrollHeight;
Correct ways in jQuery are -
$('#test').prop('scrollHeight')
OR$('#test')[0].scrollHeight
OR$('#test').get(0).scrollHeight