I will revise what bobince mentioned above since you are asking for jQuery
var div= $('#something');
var hasVerticalScrollbar= div[0].scrollHeight > div[0].clientHeight;
var hasHorizontalScrollbar= div[0].scrollWidth > div[0].clientWidth;
This is because scrollHeight and scrollWidth are DOM properties.