How to dynamically change a web page's title?

前端 未结 19 1892
遇见更好的自我
遇见更好的自我 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:23

    Maybe you can load on your title all the tabs titles in one string, and then once you load one of the tabs change the title via javascript

    ex: at first set your title to

    my app | description | contact | about us | 
    

    once you load one of the tabs run:

    document.title = "my app | tab title";
    

提交回复
热议问题