Javascript / jQuery: Detect page change using AJAX; auto refresh if the page is updated