主窗口代码:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="css/mui.css"/>
</head>
<body>
<script src="js/mui.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
mui.init()
</script>
<header class="mui-bar mui-bar-nav">
<h1 class="mui-title">基本信息输入</h1>
</header>
<div class="mui-content">
<div class="mui-input-row">
<label>学号</label>
<input type="text" id="num" placeholder="输入学号...">
</div>
<div class="mui-input-row">
<label>姓名</label>
<input type="text" id="name" placeholder="输入姓名...">
</div>
<div class="mui-input-row">
<label>年龄</label>
<input type="text" id="age" placeholder="输入年龄...">
</div>
<button type="button" id="btn" class="mui-btn mui-btn-blue mui-btn-block">保存提交</button>
</div>
<script type="text/javascript">
document.getElementById("btn").addEventListener("tap",function(){
var num=document.getElementById("num").value;
var name=document.getElementById("name").value;
var age=document.getElementById("age").value;
mui.openWindow({
url:"002.html",
id:"002",
extras:{
num:num,
name:name,
age:age
}
});
});
</script>
</body>
</html>
子窗口代码:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="css/mui.css"/>
</head>
<body>
<script src="js/mui.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
mui.init();
mui.plusReady(function(){
var test=plus.webview.currentWebview();
document.getElementById("text").innerHTML="学号:"+test.num+"\r姓名:"+test.name+"\r年龄:"+test.age;
});
</script>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">基本信息确认</h1>
</header>
<div class="mui-content">
<div>
<textarea id="text" name="" rows="3" cols="" ></textarea>
</div>
</div>
</body>
</html>