Skip to content

Commit 7e508b7

Browse files
author
zhangyonghong
committed
update
1 parent 6b894a8 commit 7e508b7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

js.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,17 @@ window.onerror = function (errMsg, scriptURI, lineNumber, columnNumber, errorObj
397397
};
398398
```
399399

400+
- [如何通过 js 修改微信浏览器的title?](https://www.zhihu.com/question/26228251/answer/32405529)
401+
```javascript
402+
var $body = $('body');
403+
document.title = 'title'; // hack在微信等webview中无法修改document.title的情况
404+
var $iframe = $('<iframe src="/favicon.ico"></iframe>').on('load', function(){
405+
setTimeout(function(){
406+
$iframe.off('load').remove()
407+
}, 0)
408+
}).appendTo($body)
409+
```
410+
400411
#### 1. 常用方法 - js
401412
- 字符串长度截取
402413
```js

0 commit comments

Comments
 (0)