使用wordpress在jquery地址上设置文档标题

使用wordpress在jquery地址上设置文档标题,jquery,ajax,jquery-address,Jquery,Ajax,Jquery Address,我有一个带有Ajax深度链接的测试wordpress博客。我想做的只是在ajax加载页面或帖子时设置一个新的标题 通过锚定标记属性title或哈希url名称调用它 任何帮助都将不胜感激 初始测试页 $("body").append("<img src='loader.gif' id='ajax-loader' style='position: absolute; left: 50%; top: 64%;' />"); var base = 'http://missionandrom

我有一个带有Ajax深度链接的测试wordpress博客。我想做的只是在ajax加载页面或帖子时设置一个新的标题

通过锚定标记属性title或哈希url名称调用它

任何帮助都将不胜感激

初始测试页

$("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;
}
});
$(“正文”)。追加(“”);
var base=http://missionandromeda.com/test',
$mainContent=$(“#容器”),
$ajaxSpinner=$(“#ajax加载程序”),
$allLinks=$(“a”),
$('a:urlInternal').live('click',函数(e){
//禁止注释相关链接(使用onclick属性)的默认操作(转到链接)
e、 预防默认值();
});
$.address.change(函数(事件){
if(事件值){
$ajaxSpinner.fadeIn();
$mainContent
.empty()
.load(base+event.value+'#content',function(){
$ajaxSpinner.fadeOut();
$mainContent.fadeIn();
});
}
var current=location.protocol+'/'+location.hostname+location.pathname;
如果(基+“/”!=当前){
var diff=当前替换(基“”);
位置=基础+'/#'+diff;
}
});

仅在Firefox中测试过,但在这里它确实可以工作:

$(document).attr('title','Your brand new title here ....');

我将寻找更具活力的东西。。反正在这儿

$('head title').html(data.match('<title>(.+)</title>')[0].replace('<title>','').replace('</title>',''));
$('headtitle').html(data.match(“(.+)”)[0]。替换(“”,)。替换(“”,);