I have a test wordpress blog with Ajax deeplinking. What I’d like to do is simply set a new head title when ajax load page or a post.
either call it by the anchor tag attribute title or hash url name.
Any help would be appreciated.
http://missionandromeda.com/test/ initial test page
$("body").append("<img src='loader.gif' id='ajax-loader' style='position: absolute; left: 50%; top: 64%;' />");
var base = 'http://missionandromeda.com/test',
$mainContent = $("#container"),
$ajaxSpinner = $("#ajax-loader"),
$allLinks = $("a"),
$('a:urlInternal').live('click', function(e) {
// Default action (go to link) prevented for comment-related links (which use onclick attributes)
e.preventDefault();
});
$.address.change(function(event) {
if (event.value) {
$ajaxSpinner.fadeIn();
$mainContent
.empty()
.load(base + event.value + ' #content', function() {
$ajaxSpinner.fadeOut();
$mainContent.fadeIn();
});
}
var current = location.protocol + '//' + location.hostname + location.pathname;
if (base + '/' != current) {
var diff = current.replace(base, '');
location = base + '/#' + diff;
}
});
i will looking for something more dynamic.. here it is anyway