test2.html 807 Bytes
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>WebView Communication</title>
</head>
<body>
<h2>接口测试2</h2>

<div id="resp"></div>


<button onclick="getStorageSync()">获取本地缓存</button>

<a href="/test/test.html">跳转测试1</a>



<br>
<img src="" alt="test" id=testImg>


</body>
<script>

    function xeJsBridgeCallback(message) {
        let jsonData = JSON.parse(message);
        document.getElementById('resp').innerHTML = '<p><strong>响应:</strong> ' + jsonData.data + '</p>';
    }

        function getStorageSync() {
            let message='{ "timestamp": 1, "unique": "123", "cmd": "getStorageSync", "params": {"key":"test1"} }';
            xeJsBridge.postMessage(message);
        }

</script>
</html>