是的,这是可能的。
您可以使用
WebViewString
在您的应用程序和
WebViewer
。在应用程序中,您可以获取并设置
WebViewer.WebViewString
属性。在您的
webviewer
,打开一个包含引用window.AppInventor对象的Javascript的页面,使用
getWebViewString()
和
setWebViewString(text)
方法。
另请参见以下内容
snippet
作为完整的示例。
<!doctype html>
<head>
<meta name="author" content="puravidaapps.com">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Test</title>
</head>
<body>
<script>
document.write("The value from the app is<br />" + window.AppInventor.getWebViewString());
window.AppInventor.setWebViewString("hello from Javascript")
</script>
</body>
</html>