title: Chrome Sending nonsense through ajax via JQuery
body: <p>Alright, I'm using chrome Version 28.0.1500.95 m and JQuery 1.9.1.</p>
  
  <p>What I'm doing is using .get to send a short byte command to a microcontroller. However in chrome for some reason a whole lot of other bytes are being sent along with my command.</p>
  
  <p>For instance here is what firefox sends: 255 246 240 </p>
  
  <p>Here is what chrome is sending from the same code source: 196 229 164 230 229 134 134 134 163 228 227 229 196 198 135 228 164 135 132 135 132 68 164 132 132 133 164 01 128 103 225 135 132 197 199 230 199 132 68 00 224 228 164 196 229 165 229 35 231 132 164 230 198 231 134 164 230 132 167 196 228 132 135 228 135 227 164 164 134 197 134 228 133 196 133 133 167 102 255 246 240</p>
  
  <p>**edit I was reading that at the wrong baud rate. It is really  giving the byte value for the sentence "GET /JS/jquery.min.map HTTP/1.1" ("/www/JS/jquery.min.map"): document open: No such file or directory" plus the bytes that it should be sending at the end.</p>
  
  <p>You'll notice that my command is at the end so maybe this is some kind of weird header.</p>
  
  <p>Below is the method that makes this ajax call.</p>
  
  <pre><code>    function SendUpdateCommand()
      {
          $.get(
                  "/cgi-bin/runcommand.sh?" + Math.floor(Math.random() * 1000) + ":cmd=254,124,1r10t300",
                  {},
                  function (responseText) {
                      var response = decodeURI(responseText || "no response text");
                      alert(response);
                      var returnValue = response.split("\n");
  
                      var bankStatus = returnValue[1].substring(0, returnValue[1].length-1);
  
                      var val = Number(bankStatus);
  
                      UpdateBankStatus(val);
                  },
                  "html"
          );
      }
  </code></pre>
  
  <p>This wouldn't be a problem but my microcontroller reads these as invalid commands and returns around ten zeros. Any help would be appreciated.</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Firefox request Headers:</p>
  
  <pre><code>GET /cgi-bin/runcommand.sh?401:cmd=254,124,1r10t300 HTTP/1.1
  Host: 192.168.2.25
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0
  Accept: text/html, */*; q=0.01
  Accept-Language: en-US,en;q=0.5
  Accept-Encoding: gzip, deflate
  DNT: 1
  X-Requested-With: XMLHttpRequest
  Referer: http://192.168.2.25/test.html
  Connection: keep-alive
  </code></pre>
  
  <p>Chrome Request Headers:</p>
  
  <pre><code>GET /cgi-bin/runcommand.sh?375:cmd=254,124,1r10t300 HTTP/1.1
  Host: 192.168.2.25
  Connection: keep-alive
  Cache-Control: max-age=0
  Accept: text/html, */*; q=0.01
  X-Requested-With: XMLHttpRequest
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
  Referer: http://192.168.2.25/test.html
  Accept-Encoding: gzip,deflate,sdch
  Accept-Language: en-US,en;q=0.8
  </code></pre>
  
  <p>Firefox Response Header:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Tue, 30 Nov 1999 00:05:11 GMT
  Server: Boa/0.94.14rc21
  Accept-Ranges: bytes
  Connection: close
  Content-Type: text/plain
  </code></pre>
  
  <p>Chrome Response Header:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Tue, 30 Nov 1999 00:00:10 GMT
  Server: Boa/0.94.14rc21
  Accept-Ranges: bytes
  Connection: close
  Content-type: text/plain
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>I think this is the packet that is causing the problem:</p>
  
  <pre><code>GET /JS/jquery.min.map HTTP/1.1
  
  Host: 192.168.2.25
  
  Connection: keep-alive
  
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
  
  Accept: */*
  
  Accept-Encoding: gzip,deflate,sdch
  
  Accept-Language: en-US,en;q=0.8
  
  
  
  HTTP/1.1 404 Not Found
  
  Date: Tue, 30 Nov 1999 19:10:14 GMT
  
  Server: Boa/0.94.14rc21
  
  Accept-Ranges: bytes
  
  Connection: close
  
  Content-Type: text/html; charset=ISO-8859-1
  
  
  
  &lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;404 Not Found&lt;/TITLE&gt;&lt;/HEAD&gt;
  &lt;BODY&gt;&lt;H1&gt;404 Not Found&lt;/H1&gt;
  The requested URL /JS/jquery.min.map was not found on this server.
  &lt;/BODY&gt;&lt;/HTML&gt;
  </code></pre>
  
  <p>This is the packet from my actual command:</p>
  
  <pre><code>GET /cgi-bin/runcommand.sh?241:cmd=170,3,254,124,1,40r4t300 HTTP/1.1
  
  Host: 192.168.2.25
  
  Connection: keep-alive
  
  Cache-Control: max-age=0
  
  Accept: text/html, */*; q=0.01
  
  X-Requested-With: XMLHttpRequest
  
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
  
  Referer: http://192.168.2.25/test.html
  
  Accept-Encoding: gzip,deflate,sdch
  
  Accept-Language: en-US,en;q=0.8
  
  
  
  HTTP/1.1 200 OK
  
  Date: Tue, 30 Nov 1999 19:10:15 GMT
  
  Server: Boa/0.94.14rc21
  
  Accept-Ranges: bytes
  
  Connection: close
  
  Content-type: text/plain
  
  OK
  170,11,0,0,
  </code></pre>
  
  <p>Somehow these two packets are getting in each others way and maybe being combined on the back end? I'm not sure. Its on a boa server so I'm not sure what all I can do about error checking of the packets.</p>
  
  <p>I fixed the problem by going back to jquery 1.8.</p>