Hello, I can not handle binary data ( getXmlHttp ), as they can be converted to Int. The task is as follows: there is a server that issues the schedule data in binary form to the request, I have to accept them, process them, convert them to integer type, and put them on the chart. Don't swear badly, I'm new to JavaScript ! Below is a screenshot from the debugger:

enter image description here

Here is the code:

     function ask_values ​​() {
             req = getXmlHttp ();
             req.open ('POST', 'GetChart.cgi?', true);
             req.onreadystatechange = updatePage;
             req.send ('0')
         }

         function updatePage () {
             if (req.readyState == 4) {

                 var uInt8Array = new Uint8Array (req.response);
                 /*console.log (req.response );*/
                 add_voltage_data (uInt8Array);

             }
         }

  • In my opinion, in any case, just a line is transmitted, what then to do with it is already up to you here like the rules article habrahabr.ru/post/120917 - Serge Esmanovich
  • Something does not work - I get "undefined" (((... On the link I bring a screenshot from the debugger: dropbox.com/s/i2zad1f3ofjn51c/response.png?dl=0 > - fin
  • Is the encoding exactly okay? - Serge Esmanovich
  • What encoding? - fin
  • write the code otherwise it is on TNT in the battle of psychics you need to contact, I can certainly give you a hundred reasons for why your leg hurts, but I have the same and it doesn’t hurt. - Serge Esmanovich

0