Jump to content

Displaying a Websocket Message.


Recommended Posts

I have created a Websocket between my webpage and a application acting like a server on my computer.

And the program is sending data though the Websocket, but i am trying to display it.


When i open the page in the Chrome Developers Tools i get this.




Now im trying to figure out how to display the data into a div on my webpage.

The old way i was displaying it was this way.



jqXHR = $.getJSON("http://" + location.hostname + "/add_definition?definition_name=RADIO&name=COM1_A&PropertyName=COM ACTIVE FREQUENCY:1&UnitName=MHz&DatumType=FLOAT32", function(dane) {});jqXHR = $.getJSON("http://" + location.hostname + "/get?definition_name=RADIO", function(data){definition_data = data;});if (definition_data == undefined)return;var C1A = document.getElementById("COM1A");C1A.innerHTML = definition_data.COM1_A.toFixed(3);


<div class="DISP1" id="COM1A" type="button" name="COM1A" onclick="SETFREQ('com1_swap',1)">XXX.XXX</div>

Im not sure how to display the data from the message into my page to display.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...