How to dynamically change a web page's title?

前端 未结 19 1449
遇见更好的自我
遇见更好的自我 2020-11-22 08:05

I have a webpage that implements a set of tabs each showing different content. The tab clicks do not refresh the page but hide/unhide contents at the client side.

No

19条回答
  •  无人及你
    2020-11-22 08:47

    I just want to add something here: changing the title via JavaScript is actually useful if you're updating a database via AJAX, so then the title changes without you having to refresh the page. The title actually changes via your server side scripting language, but having it change via JavaScript is just a usability and UI thing that makes the user experience more enjoyable and fluid.

    Now, if you're changing the title via JavaScript just for the hell of it, then you should not be doing that.

提交回复
热议问题