mui--plus를 통해.webview.create webview를 만들고 새 페이지를 열고 새 페이지로 보내기

9896 단어

create_webview_home.html(홈페이지)

doctype html>
<html>

    <head>
        <meta charset="UTF-8">
        <title>title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <link href="css/mui.min.css" rel="stylesheet" />
    head>

    <body>
        <button id="button1" class="mui-btn mui-badge-purple"> button>
        <script src="js/mui.min.js">script>
        <script type="text/javascript">
            mui.init();
            document.getElementById("button1").addEventListener('tap', function() {
                mui.plusReady(function() {
                    var nwating = plus.nativeUI.showWaiting(); // 
                    var webview_sub = plus.webview.create(
                        'create_webview_sub.html',
                        'create_webview_sub', {}, {
                            name: 'davis'
                        }); // webview 
                    webview_sub.addEventListener('loaded', function() {
                        nwating.close(); // 
                        webview_sub.show('slide-in-right', 150); // webview 
                    }, false);
                });
            })
        script>
    body>

html>

 

create_webview_sub.html(새 페이지)

doctype html>
<html>

    <head>
        <meta charset="UTF-8">
        <title>title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <link href="css/mui.min.css" rel="stylesheet" />
    head>

    <body>
        <div id="div1">div>
        <script src="js/mui.min.js">script>
        <script type="text/javascript">
            mui.init();
            mui.plusReady(function  () {
                document.getElementById("div1").innerText='hi,'+plus.webview.currentWebview().name;
            })
        script>
    body>

html>

 
다음으로 전송:https://www.cnblogs.com/beast-king/p/9118748.html

좋은 웹페이지 즐겨찾기