Hello,
I need to run a web page inside Snap! to communicate with a websocket client like here :
<html><head><script src="bundle.js"></script></head>
<body>
Test api Toto
<script>
// var toto_0 = totoApi.createClient("ws://127.0.0.1:8597");
var toto = new Toto();
toto.connect();
toto.sendCode("call toto_function(0,255,255) \n");
</script>
</body></html>
Could you help me to do that ? Or give me some examples. Thanks.
Second, your html page loads a bundle.js script. You can copy all that js content, directly inside your JS block.
In some cases, if the JS library is on Internet and you want to load dinamically (without tracking their possible changes), you can make a JS code to load that library on your DOM (Snap! page). Tell me if you need this.
The problem is that bundle.js is a very complicated function obtained by applying browserify to another script.js to bundle up all the dependencies I need.
I don't know how to execute the javascript block with it (what arguments do I have to declare).
Moreover bundle.js is 1.3M large.