Source

MyIOTest / myiotest / templates / index.mako

The default branch has multiple heads

Full commit
<html>
    <head>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
        <script>
            $(function() {
    ws = new WebSocket("ws://${host}:${port}/jobs/1");
    ws.onmessage = function(msg) {
        $("body").append("<p>" + msg.data + "</p>");
    };
    STARTED = false;
    $("#start-stop").click(function(evt) {
        $.post("/jobs/1", {state: STARTED ? "stop" : "start"}, function(result) {
            STARTED = !STARTED;
            $('#start-stop span').text(STARTED ? "on" : "off");

        });
    });
});
        </script>
    </head>
    <body>
        <h1>Hi</h1>
        <button id="start-stop">Job 1 <span>off</span></button>
    </body>
</html>