//返回上一页
函数后退
console.log ('单击后退);
//window.history.back (;
//plus.webview.currentWebview ().close );
if () navigator.useragent.indexof (msie ) )=0) (navigator.user agent.index of ) )0)/ie
if(history.length0) {
window.history.go(-1;
console.log(ie浏览器单击“后退”);
} else {
console.log(ie浏览器返回源);
window.open (Baidu ://back webview );
}
} else { //非IE浏览器
navigator.user agent.index of (' Firefox ' )=0 ||
navigator.user agent.index of (' opera ' )=0 ||
navigator.user agent.index of (' safari ' )=0 ||
navigator.user agent.index of (' chrome ' )=0 ||
navigator.user agent.index of (' WebKit ' )=0) }
if(window.history.length1) {
window.history.go(-1;
console.log (非IE浏览器单击了“后退”);
} else {
window.open (Baidu ://back webview );
console.log (非IE浏览器返回源);
}
(else(/未知浏览器
window.history.go(-1;
console.log ('未知浏览器单击后退);
}
}
}
其中window.open (Baidu ://back webview ); 该方法是与前端约定的标识,如果前端的webview被baidu://backWebView监听到,则关闭webview即可。