Modify the title of WeChat under ios and the title of ios mail

Source: Internet
Author: User

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 );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.