webview 小程序内嵌web-view 如何实时更新小程序的标题?

小程序 文章 2021-01-27 10:41 914 0 全屏看文

AI助手支持GPT4.0

webview 小程序内嵌web-view 如何实时更新小程序的标题?How to update the title of the applet in real time with the embedded web-view of the webview applet?

webview 小程序内嵌web-view 如何实时更新小程序的标题?

相关步骤如下:

  1. web-view src为 hostname/p 页面title为 p 此时小程序的标题也为 p
  2. 点击 hostname/p 页面中的a 标签 跳转到了 hostname/p/1 title为p1 此时小程序的标题还是 p

如何使小程序的标题也变成p1

The related steps are as follows: Web view SRC is hostname / P, page title is p, and the title of the applet is also p. click the a tag in the hostname / P page to jump to hostname / P / 1, and the title of the applet is P1. How can the title of the applet be changed to P1

回答:

大胖余:

webview里面嵌套的H5 当前小程序的标题是 网页里面的title 网页里面的是什么在小程序里面的标题就是什么,如果修改的话可以用

document.title = '需要设置的值';

brave:

webview下小程序导航栏标题即为网页标题

默认²⁰²⁰:

p1HTML页面内的title标签设置为p1就行

mxf:不行,已经设过了,你可以试下

-EOF-

AI助手支持GPT4.0