Edit in JSFiddle

write("Step 1. Creating the WebSocket");
var socket = new FIMKSocket("wss://cloud.mofowallet.org:7986/ws/");
socket.ready(function () {
    write("Step 2. Socket is ready");
});
<script type="text/javascript">
function write (text) {
    var p = document.createElement('p');
    p.textContent = text;
    document.getElementById("output").appendChild(p);
}
</script>
<div id="output"></div>