Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 1ffa1a955d
34 lines (28 sloc) 1.065 kB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<!-- note, a debug version is also available to us, that would validate
all sorts stuff, including the inputs and outputs to our functions -->
<script src="../src/jschannel.js"></script>
<script>
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();
});
</script>
</head>
</html>
Jump to Line
Something went wrong with that request. Please try again.