解决微信浏览器内返回上一个网页要求网页刷新的处理方式:
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">在返回的页面中加入以上代码,设置页面无缓冲,则每一次到达该页面都会使得该页面重新请求。
APP中内嵌了H5页面,不要用cookie。不要用session。原因:开发中使用COOKIE在IPhone5中出现cookie错误,设置cookie不成功,在最开始成功,一段时间之后,不知道原因的cookie出现了问题。
解决方案:使用类似微信oauth2.0的方式,在整个过程中传递一个加密的值作为标识。
APP中内嵌H5,多重页面的跳转,返回某一个固定页面时,IOS与Android处理各不同,需要注意,最好在完成基本功能之后先与APP端开发沟通,处理起来IOS比较简单,Android可能会复杂一些,目前博主公司没有找到好办法,两者如果是跳回第一个页面,APP端比较好实现,随意挑别的任意页面复杂。
IOS内嵌的H5页面,如果需要调用到APP的JS接口,需要H5是当前webview的第一个页面。
如果从主界面跳入摸个H5模块,中间经历了某些中转跳的页面,在返回的时候会出现该页面,注意处理。
判断APP或者微信平台JS:
//手机端判断各个平台浏览器及操作系统平台
function checkPlatform(){
var platform_pt = "";
if(/android/i.test(navigator.userAgent)){
//document.write("This is Android'browser.");//这是Android平台下浏览器
platform_pt = "app_android";
}
if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)){
//document.write("This is iOS'browser.");//这是iOS平台下浏览器
platform_pt = "app_ios";
}
if(/Linux/i.test(navigator.userAgent)){
//document.write("This is Linux'browser.");//这是Linux平台下浏览器
platform_pt = "linux_browser";
}
if(/Linux/i.test(navigator.platform)){
//document.write("This is Linux operating system.");//这是Linux操作系统平台
platform_pt = "linux_opera";
}
if(/MicroMessenger/i.test(navigator.userAgent)){
//document.write("This is MicroMessenger'browser.");//这是微信平台下浏览器
platform_pt = "weixin";
}
return platform_pt;
}
7. 还有很多坑....先去搞开发,有时间写。