remove( )

MUI HTML5

MUI

remove( )

移除子Webview窗口


void wobj.remove( webview );
						

说明:

从当前Webview窗口移除指定的子Webview窗口,若指定的webview对象不是当前窗口的子窗口则无任何作用。 移除后子Webview窗口不会关闭,需要调用其close方法才能真正关闭并销毁。

参数:

返回值:

void : 无

示例:


<!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"});
	ws.append(embed);
}
if(window.plus){
	plusReady();
}else{
	document.addEventListener("plusready",plusReady,false);
}
// 移除子Webview窗口
function removeWebview() {
	ws.remove(embed);
	embed.close();
}
	</script>
	</head>
	<body>
		移除子Webview窗口
		<button onclick="removeWebview()">remove</button>
	</body>
</html>