tanya master, saya buat javascript koneksi ke web socket saya belum berhasil memisahkan 2 kondisi(result) outputnya , mohon bantuannya <script> var ws = new WebSocket('wss://www.binary.com/websockets/v3?l=RU'); function setup() { //output2 = document.getElementById("output2"); ws.onopen = function(evt) { ws.send(JSON.stringify({ticks:'R_50'})); } ws.onmessage = function(msg) { var quote = JSON.parse(msg.data).tick.quote; var newquote = quote.substr(-1); //log(newquote);//here should be semi-colon log(quote, "output"); log(newquote, "output2"); } } // Let id of div be an argument of function function log(info, id) { var p = document.getElementById(id); p.innerHTML = info; } function sendMessage(msg) { ws.send(msg); log("TICKS"); ws.close(); } window.addEventListener("load", setup, false); </script> penjelasan : quote result 1234.1234 newquote result 1,2,3,4,5,6(last digit) nah gimana ya caranya memisahkan 2 output tersebut dengan berbeda div
0 jempol