forked from illusionspaces/WKJavaScriptBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·41 lines (31 loc) · 1.44 KB
/
index.html
File metadata and controls
executable file
·41 lines (31 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<html>
<head>
<title>WKJSBridge</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<script type="text/javascript" src="WKJSBridge.js" ></script>
<script language="javascript">
function pokeNative() {
//功能模块
var service = 'WKCommonPlugin';
//具体功能
var action = 'asynDisplayCommon';
//业务参数
var command = {
'url':'https:www.baidu.com'
}
window.WKJSBridge.callNative(service, action, command, function success(res) {
document.getElementById("returnValue").value = res.result;
}, function fail(res) {
document.getElementById("returnValue").value = res.result;
});
}
</script>
</head>
<body>
<h1>按钮调用</h1>
<input type="button" value="调用客户端" onclick="pokeNative()" />
<h1>回调结果展示区</h1>
<textarea id ="returnValue" type="value" rows="5" cols="40">
</textarea>
</body>
</html>