Using Javascipt with Snap!

Heya, all…

Is there any documentation about how to add javascript to a Snap! project? Or examples?

Am looking for general “how-tos” and pointers, but specifically am also wondering how to “include” external javascript, either local or remote?

Thank you!
Mike

I think this was answered back on the Scratch forum, right?

Aside from the Scratch forum, here’s a few places to look:

  • The example project ‘JSFunctions’ (File → Open Project → Examples)
  • The big integers library
  • The Web Services library
  • Pixel
  • Bigger Data
  • Text To Speech

script variables ((finish)) ⮞
set [finish ⮟] to (call (JavaScript function ( ⮞ ) {

var done = false;
var script = document.createElement('script');
script.src = 'src';
script.onload = function () {done = true; };
document.head.appendChild(script);
return function () {return done; };

} ) ⮞ )
wait until (call (finish) ⮞ )