Is there a way, using jQuery, to change the document.title after the page has loaded?

前端 未结 5 1282
半阙折子戏
半阙折子戏 2020-12-18 13:00

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

5条回答
  •  甜味超标
    2020-12-18 13:42

    $('title').text("Boo"); is not good idea because IE8 has problem with that.
    this bug is reported Here but jQuery developers did not solve that and their solution is Use document.title='Boo';.

    my idea is that

    1. using document.title is best option and it is cross browser solution
    2. but if you are used to use jQuery you can use $(document).attr('title', 'new title');. i tested it and has no problem with major browsers and IE8

提交回复
热议问题