Modify the title under ios and the title of ios mail
Many developers may have encountered this problem. The title of the page under ios cannot be changed, but android can directly use: document. title = "your title ".
The following is the hack to solve this problem:
1. jquery Method
SetTimeout (function () {// jQuery var $ body =$ ('body'); document. title = 'test'; // the document cannot be modified in the webview. title var $ iframe = $ ('<iframe src = "/favicon. ico "> </iframe> '); $ iframe. on ('load', function () {setTimeout (function () {$ iframe. off ('load '). remove () ;}, 0 );}). appendTo ($ body) ;}, 0 );
2. jquery independent
// The following code does not depend on jqsetTimeout (function () {// use the iframe onload event to refresh the document page. title = 'test'; var iframe = document. createElement ('iframe'); iframe. style. visibility = 'ddn'; iframe. style. width = '1px '; iframe. style. height = '1px '; iframe. onload = function () {setTimeout (function () {document. body. removeChild (iframe) ;}, 0) ;}; document. body. appendChild (iframe) ;}, 0 );