如何更改页面标题
Possible Duplicate:
jQuery: how to change title of document during .ready()?
How to change the name of the page with jquery and ajax?
I would like to use php script and call the load function. The function returns the title to me. How do I set the page title?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您只需执行
document.title = 'foo';
时,JQuery 对于设置标题可能有点过大,但如果您确实想使用 JQuery,则可以执行
$("title").text ("foo");
虽然它可能会慢很多,但如果你只做一次我就不会担心。
JQuery is probably overkill for setting a title when you can just do
document.title = 'foo';
but if you really want to use JQuery you can do
$("title").text("foo");
It's probably a lot slower though, although if you're only doing it once I wouldn't worry about that.
我也想知道这是否有效:
also i wonder if this will work: