Home  >  Article  >  Web Front-end  >  How to use mui back to return to refresh the page

How to use mui back to return to refresh the page

亚连
亚连Original
2018-06-22 14:30:393143browse

The editor below will share with you an example of mui back returning to refresh the page. It has a good reference value and I hope it will be helpful to everyone. Let’s follow the editor and take a look.

2 page simulation

1.html

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link href="../../css/mui.min.css" rel="external nofollow" rel="external nofollow" rel="stylesheet" />
		<script src="../../../js/mui.min.js"></script>
	</head>
	<body>
		
		<script type="text/javascript" charset="utf-8">
			mui.init()
			mui.plusReady(function(){
				alert(&#39;1&#39;)
//				var self=plus.webview.currentWebview();
//				console.log(JSON.stringify(self))  
				mui("body").on("tap",".a",function(){
					 mui.openWindow({
					  url:"2.html",
					  id:"a2",
					 })
				})
			});
		</script>
		
		<a href="javascript:void(0)" rel="external nofollow" rel="external nofollow" class="a">跳到a2</a>
	</body> 
</html>

2.html

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link href="../../css/mui.min.css" rel="external nofollow" rel="external nofollow" rel="stylesheet" />
		<script src="../../../js/mui.min.js"></script>
	</head>
	<body>
		
		<script type="text/javascript" charset="utf-8">
			mui.init()
			mui.plusReady(function(){
//				var self=plus.webview.currentWebview();
//				console.log(JSON.stringify(self)) 
				var old_back = mui.back;
				mui.back = function() {
					var wobj = plus.webview.getWebviewById("HBuilder");//注意 HBuilder 是  1.html 的 ID 你如果1.html 有ID  要替换掉HBuilder,
					wobj.reload(true);
					old_back()
				}	
			});
		</script>
		
		<a href="javascript:void(0)" rel="external nofollow" rel="external nofollow" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left">返回刷新</a>
	</body>
</html>

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Related folder structure configuration in vue

##How to configure the interface proxy using vue-cli

How to use form-data format to transfer files in NodeJs

How to implement lazy loading of images in WeChat applet

How to achieve focus map effect using js

The above is the detailed content of How to use mui back to return to refresh the page. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn