未验证 提交 55983516 编写于 作者: 葛亚芳 提交者: Gitee

update en/application-dev/reference/apis/js-apis-webview.md.

Signed-off-by: N葛亚芳 <geyafang@huawei.com>
上级 8f214bfb
......@@ -1739,9 +1739,9 @@ var output = document.querySelector('.output');
window.addEventListener('message', function (event) {
if (event.data == '__init_port__') {
if (event.ports[0] != null) {
h5Port = event.ports[0]; // 1. Save the port number sent from the eTS side.
h5Port = event.ports[0]; // 1. Save the port number sent from the ArkTS side.
h5Port.onmessage = function (event) {
// 2. Receive the message sent from the eTS side.
// 2. Receive the message sent from the ArkTS side.
var msg = 'Got message from ets:';
var result = event.data;
if (typeof(result) == "string") {
......@@ -1763,7 +1763,7 @@ window.addEventListener('message', function (event) {
}
})
// 3. Use h5Port to send messages to the eTS side.
// 3. Use h5Port to send messages to the ArkTS side.
function PostMsgToEts(data) {
if (h5Port) {
h5Port.postMessage(data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册