kytschBASIC

Put down that phone!
Please view me on real computer.

ASYNCFUNCTION
NAME, ARGUMENTS (optional)
Requires arcade library

This will allow you to create an arcade function which is an async javascript function with jquery support.

Example

INCLUDE arcade

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/>
<div id="arcade">
<span id="arcade-text">Arcade support</span>
</div>

Demo



Arcade support

See also