ASYNCFUNCTION
NAME, ARGUMENTS (optional)
This will allow you to create an arcade function which is an async javascript function with jquery support.
Example
ASYNCFUNCTION "updateText", "text='Arcade support'"
await sleep(3000);
$("#arcade-text").html(text);
END ASYNCFUNCTION
LINE BREAK
JAVASCRIPT
updateText(event, "Arcade support enabled");
END JAVASCRIPT
LINE BREAK
SCREEN "arcade"
PRINT "Arcade support",,"arcade-text"
END SCREEN
Output
<script type="text/javascript">async function updateText(event, text='Arcade support') {
await sleep(3000);
$("#arcade-text").html(text);
}</script><br/>
<script type='text/javascript'>
$(document).ready(function() {
updateText(event, "Arcade support enabled");
});
</script><br/>
<style>
#arcade {background-color: rgba(255,255,255,1);color:rgb(0,0,0);height: 100vh;}
</style>
<div id="arcade">
<span id="arcade-text">Arcade support</span>
</div>
Demo
Arcade support