Edit in JSFiddle

var socket = new FIMKSocket("wss://cloud.mofowallet.org:7986/ws/");
socket.ready(function () {
  socket.getBlockchainState(null, function (data) {
    write("Blockheight is "+data.height);
  });
});
<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>