Solved bug: href='#' made the browser go to the top of the page when an Ajax link was clicked. Replaced with href='javascript:;'. Also uncommented dataType in jQuery.ajax() to remove the 'unexpected token o' error.