如何通过jQuery更改页面标题? [英] How to change the title of page through jQuery?

查看:83
本文介绍了如何通过jQuery更改页面标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想动态更改页面标题.我的页面上有很多AJAX请求.对于每种类型的回复,我都希望使用标题进行通知.

I want to change the title of page dynamically. I have lots of AJAX request going on in my page. On each type of response I want to notify this using the title.

那么,如何通过jQuery更改页面标题?

So, How to change the title of page through jQuery?

推荐答案

document.title = "newtitle" 

据我所知,

是唯一有效的方法.

is the only valid way as far as I know. manipulating

$("title") 

将在 IE8 失败.

title标签和document.title之间有细微的差别,看来浏览器将它们区别对待.

There are subtle differences between the title tag and document.title, it appears browsers treat them differently.

这篇关于如何通过jQuery更改页面标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆