Is there a way, using jQuery, to modify the document.title file after the page loads?

I encoded myself into a corner. Does anyone know the answer? Thanks!

+3
source share
5 answers

This will also work:

$('title').text("Boo");
+10
source
document.title = 'new value';

This does not work for you?

+9
source

Try:

$(document).ready(function() {
    this.title = 'foo'
})
+4

, :

$(document).attr('title', 'new title');
+3

$('title').text("Boo"); , IE8 .
jQuery , document.title='Boo';.

,

  • use document.titleis the best option and this is a cross browser solution
  • but if you use jQuery you can use $(document).attr('title', 'new title');. I tested it and have no problems with major browsers and IE8
+1
source

Source: https://habr.com/ru/post/1718948/


All Articles