问题描述:web
当咱们用微信浏览器打开页面时候,想要动态修改title值,就须要使用:浏览器
document.title = "title"
可是IOS系统下,微信等webview中没法修改第一个页面的title,在从这个页面点击进去的其余页面就能够修改微信
解决办法:微信开发
function SetTitle(name){ var ua = navigator.userAgent.toLowerCase(); if (/iphone|ipad|ipod/.test(ua)) { var $body = $("body"); document.title = name; // hack在微信等webview中没法修改document.title的状况 var $iframe = $("<iframe src='/favicon.ico'></iframe>"); $iframe.on("load",function() { setTimeout(function() { $iframe.off("load").remove(); }, 0); }).appendTo($body); } else { document.title = name; } } module.exports = SetTitle;
问题描述:app
在微信开发中,咱们在使用事件委托时候,若是委托的父元素是body,IOS下不会起做用,只有事件主动触发,该事件才会被触发iphone
错误用法:code
$('body').on('click', '.js_list li', function(){ //xxx });
正确用法:事件
$('.js_list').on('click', 'li', function(){ //xxx });