This is a simple example of how you can connect to the BX.in.th websocket API using javascript to get realtime trade and orderbook data.
You should be able to run the example.html out-of-the-box in your browser, and it should start displaying trades and orderbooks.