Webview窗口关闭事件
说明:
EventCallback 类型
当Webview窗口关闭时触发此事件,类型为EventCallback。
示例:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Webview Example</title>
<script type="text/javascript">
var ws=null,embed=null;
// H5 plus事件处理
function plusReady(){
ws=plus.webview.currentWebview();
embed=plus.webview.create("http://weibo.com/dhnetwork","",{top:"46px",bottom:"0px"});
embed.onclose=embedClose;
ws.append(embed);
}
if(window.plus){
plusReady();
}else{
document.addEventListener("plusready",plusReady,false);
}
// 页面关闭事件回调函数
function embedClose(e){
alert( "Closed!" );
}
</script>
</head>
<body>
Webview窗口关闭事件
<button onclick="embed.close()">onclose</button>
</body>
</html>