javascript - Node js, Call WebSocket server from oracle apex -


i trying create web-sockets in apex automatic refresh node

but getting error not valid json:

java script code

$(function(){    window.websocket = window.websocket || window.mozwebsocket;      if (!window.websocket) {      console.log('sorry websockets');    }    else {      var connection = new websocket('ws://127.0.0.1:1337');        connection.onerror = function (error) {        console.log( 'sorry, there problem connection or server down.');      };        connection.onmessage = function (message) {         console.log(message.data);           try {          var json = json.parse(message.data);            if (json.message=='refresh') {            greport.pull();          }          else {             console.log(json.message);          }           }         catch (e) {          console.log('thisnot valid json: ' + message.data);        }      };    }  });


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -