jQuery: how to change title of document during .ready()?

前端 未结 8 1880
逝去的感伤
逝去的感伤 2020-11-27 12:37

I am using some nested layouts in Ruby on Rails, and in one of the layouts i have a need to read in a string from a div and set that as the title of the document. What is co

8条回答
  •  天命终不由人
    2020-11-27 13:13

    Do not use $('title').text('hi'), because IE doesn't support it.

    It is better to use document.title = 'new title';

提交回复
热议问题