I had the same requirement to update the page title after ajax loading and what I used was a single request, no special attributes needed to be set in your HTML:
var contentWrap = $('#content-wrap'), contentId = '#content'; $.ajax({ url: hash.replace(/^#!\//, '') + '.html', success: function(text) { var oldContent = contentWrap.find(contentId), newPage = $(text), newContent = newPage.find(contentId); oldContent.remove(); contentWrap.append(newContent);
Misha reyzlin
source share