关闭Webview窗口
void plus.webview.close( id_wvobj, aniClose, duration, extras );
关闭已经打开的Webview窗口,需先获取窗口对象或窗口id,并可指定关闭窗口的动画及动画持续时间。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Webview Example</title>
<script type="text/javascript">
// H5 plus事件处理
function plusReady(){
}
if(window.plus){
plusReady();
}else{
document.addEventListener("plusready",plusReady,false);
}
// 关闭自身窗口
function closeme(){
var ws=plus.webview.currentWebview();
plus.webview.close(ws);
}
</script>
</head>
<body>
关闭Webview窗口<br/>
<button onclick="closeme()">close</button>
</body>
</html>