获取当前窗口的WebviewObject对象
WebviewObject plus.webview.currentWebview();
说明:
获取当前页面所属的Webview窗口对象。
参数:
无
返回值:
WebviewObject : Webview窗口对象
示例:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Webview Example</title>
<script type="text/javascript">
// H5 plus事件处理
function plusReady(){
var ws=plus.webview.currentWebview();
console.log( "当前Webview窗口:"+ws.getURL() );
}
if(window.plus){
plusReady();
}else{
document.addEventListener("plusready",plusReady,false);
}
</script>
</head>
<body>
获取自身Webview窗口
</body>
</html>