开发者

How do I reset the title in an HTML page, without reloading?

I am trying to reset the title of the page in JQuery, without having to refresh it. Every place I have looked allows me to use either:

$('title').text('foo');

OR

$(document).attr('title', 'foo2');

Which [apparently] needs a refresh to work properly. I am loading开发者_StackOverflow information into a div in the main page and never needing to refresh the page. Does anyone have any ideas? Thanks in advance!


Not much to do with jquery, except for when (ie handling some event) you decide to change the page title: document.title = 'something';


can't you just use document.title = "Something new";?


yes I am agree with @sidyll Apparently 80% of jQuery users don't now JavaScript so sometime try javascript concepts also.

but you can do with jquery as:

<script type="text/javascript">
$(function(){
    $('#changeTitle').click(function(){
        $('title').html('New title');
    });
});
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜