Question on a Feature
Issue #41
resolved
Hi John,
Is there any way to access Javascript code from microBlocks, similar to SNAP! ?
Comments (2)
-
repo owner -
repo owner - changed status to resolved
Question answered
- Log in to comment
No, because the MicroBlocks IDE isn’t implemented in JavaScript.
However, there is a way to interact with MicroBlocks from JavaScript. If you turn on “show advanced blocks” and start the “Mozilla WebThing server” you can use HTTP requests to get/set variables and send/receive broadcasts. Here’s a summary of the URL scheme:
You can print this summary in the browser by typing:
in the URL field of your browser. Note that variable names containing spaces or other non URL-safe characters must be URL encoded (e.g. a space is encoded as %20).