Before Ajax will be sent to the server name document.title ("My Blog") on some variable. Then, when the answer comes, set document.title to document.title + '-' + BLOGPOST_TITLE
so you have in html:
... <title> My blog </ Title> ...
and in JS:
var TITLE = document.title;
function getBlogSpotEntry () {
Ajax.Request (url, {
onSuccess: function (response) {
var entryTitle = getTitle (response.responseText);
document.title = TITLE + "-" + entryTitle;
}
})
}
source
share