H5 Page Setup title, set the default title is empty, the flicker problem solving title

H5 pages often need to dynamically set the title information via js:

When updating the content title by js after the page is loaded, it will Caton, glitters default title content, later becoming updated content (if the HTML title tag is empty, the default browser will display the information for the page address);

To solve the above problems can be inserted before the html template page content script tag, document.title = '\ u200E'; title set is empty, the contents of the corresponding title set in after the page loads;

<!DOCTYPE html>
<html lang="zh-cn">
...
<title> </title>
<script>
       document.title = '\u200E';
</script>
...

<div id="app"></div>

<script>
       document.title = '....';
</script>

 

Guess you like

Origin www.cnblogs.com/pangys/p/12551744.html