clear( )

MUI HTML5

MUI

clear( )

清空原生Webview窗口加载的内容


void wobj.clear();
						

说明:

清除原生窗口的内容,用于重置原生窗口加载的内容,清除其加载的历史记录等内容。

参数:

返回值:

void : 无

示例:


<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8">
	<title>Webview Example</title>
	<script type="text/javascript">
var embed=null;
// H5 plus事件处理
function plusReady(){
	embed=plus.webview.create("http://weibo.com/dhnetwork","",{top:"46px",bottom:"0px"});
	plus.webview.currentWebview().append( embed );
}
if(window.plus){
	plusReady();
}else{
	document.addEventListener("plusready",plusReady,false);
}
// 清空Webview窗口
function webviewClear() {
	embed.clear();
}
	</script>
	</head>
	<body>
		清空原生Webview窗口加载的内容
		<button onclick="webviewClear()">Clear</button>
	</body>
</html>