Skip to content

cimhealth/electron-web-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webview webpage 互相传值

http://localhost:8080/login.jsp

写以下js


<a onclick="hmptestSend(11)">test</a>
<script>
//                    function hmptestSend(num){
//                        alert('Number is send from the webview:'+num);
//                        console.log(num);
//                    }
    function hmptestSend(num){
        alert('{"method": "add","param": 1}');
        console.log('{"method": "add","param": 1}');
    }
    function hmptestReceive(num){
        alert('Number is received from the webview:'+num);
    }
</script>

webpage 将 11打印到控制台,webview监听到控制台的11
将11 + 20 ,返回给webpage

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published