Using HTML
//Set in advance the UI location values as variables
let position = 'middle';
let width = 400;
let height = 400;
// Create a tag called "state" using "my.html" and pass the value "hello"
let _widget = App.showWidget('my.html', position, width, height);
_widget.sendMessage({
state: "hello",
}); <html>
<div id="test">-</div>
<script type="text/javascript">
**window**.**addEventListener**('message', function(e) {
// Since the sent tag value is "state", it is received in the form below
var state = e.data.state;
// Apply this to "id test" above
document.getElementById("test").innerText = state;
})
</script>
</html>Last updated
Was this helpful?