JSFiddle - React, Tailwind, and code Playground

by dandiebolt

HTML

<script src="https://www.quickbase.com/db/befe2yy7d?a=dbpage&amp;pagename=jschannel.js"></script>
<h1>Hello from Child</h1>

JavaScript

var chan = Channel.build({window: window.parent, origin: "*", scope: "testScope"});
chan.bind("reverse", function(trans, s) {
    if (typeof s !== 'string') {
        throw [ "invalid_arguments", 'argument to reverse function should be a string' ];
    }
    return s.split("").reverse().join("");
});

chan.bind("sendNotification", function(trans, s) {
    chan.notify({method: "notify", params: "Hi my name is Simon, and I like to do drawings!" });
});

chan.bind("charify", function(trans, a) {
    a.startParse();
    for (var i = 0; i < a.word.length; i++) {
        a.gotChar(a.word[i]);
    }
    a.parseComplete();
});