I'm following this tutorial: https://appinventor.mit.edu/explore/ai2/webview-javascript
This is my block code:
This is the error I get (I'm using the emulator on Windows 10 with aiStarter):
I've tried alternative paths like http://localhost/javascriptWebViewProcessor.html, but it doesn't work.
javascriptWebViewProcessor.html:
<!doctype html>
<head>
<title>WebView Javascript Processor</title>
</head>
<body onload="processJavascript();">
<b>This page includes a javascript function that reverses text.</b>
<p>The javascript function incorporates a special App Inventor feature called <i>window.AppInventor.getWebViewString()</i>, which allows App Inventor apps to communicate with the WebViewer component's internal processing of javascript.
<p>This simple example shows how to use the <i>window.AppInventor.getWebViewString()</i> function to pass data to and from the WebViewer component, and thereby an App Inventor app.
<script>
var result = new Date().toString();
var appInventorInput = window.AppInventor.getWebViewString();
function processJavascript() {
if (appInventorInput.length > 0) {
document.write( "WebView InputString received FROM app:" + appInventorInput );
result = appInventorInput.split("").reverse().join("");
document.write( "<p/>WebView InputString sending BACK TO app:<br/>" +
result );
} else {
document.write( "No WebView InputString set by app at: <br/>" + result );
}
window.AppInventor.setWebViewString( result );
}
</script>
</body>
</html>
I tried looking through the forums and while I have found threads with this issue, they always point back to the localhost solution or put the HTML file in an actual server so I don't have to access it locally.
I guess my question is what am I doing wrong and what is the path to these Media files: