좋아, 크롬 버전 28.0.1500.95 m 및 JQuery 1.9.1을 사용하고 있습니다.크롬 JQuery를 통해 아약스를 통해 넌센스 전송
내가하고있는 일은 .get을 사용하여 짧은 바이트 명령을 마이크로 컨트롤러에 보냅니다. 그러나 크롬에서 어떤 이유 때문에 다른 많은 바이트가 내 명령과 함께 전송됩니다. 여기에서 예를 들어
파이어 폭스 보내는 것이다 196 229 164 230 229 134 134 134 163 228 227 229 196 198 135 228 164 135 132 : 동일한 코드 소스로부터 송신되는 어떤 크롬 255 246 240
여기인 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
** 편집 내가 잘못된 전송 속도로 읽었습니다. 그것은 정말로 "GET /JS/jquery.min.map HTTP/1.1"("/www/JS/jquery.min.map") 문장에 대한 바이트 값을 제공하고 있습니다 : document open : No such file or directory "와 이 말에 전송해야한다고 바이트.
당신은 내 명령은 어쩌면이 이상한 헤더의 일종 끝에 것을 알 수 있습니다. 아래
이 아약스 호출을하는 방법입니다.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"
);
}
이 는 문제가되지 않을 것입니다하지만 내 마이크로 컨트롤러 10 제로 주위에 이러한 잘못된 명령과 수익을 읽습니다. 어떤 도움을 주시면 감사하겠습니다.
감사
편집
파이어 폭스 요청 헤더 :
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
크롬 요청 헤더 :
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
파이어 폭스 응답 헤더 :
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
크롬 응답 헤더 :
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
편집
나는이 문제의 원인이되는 패킷 생각 :
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
<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD>
<BODY><H1>404 Not Found</H1>
The requested URL /JS/jquery.min.map was not found on this server.
</BODY></HTML>
이 내 실제 명령의 패킷입니다 :
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,
어떻게 든이 두 패킷은 서로 다른 방식으로 전달되고 있으며 백엔드에서 결합되었을 수 있습니까? 나는 잘 모르겠다. 그 보아 서버에 그래서 내가 패킷의 오류 검사에 대해 무엇을 할 수 있는지 잘 모르겠습니다.
jquery 1.8로 돌아가서 문제를 해결했습니다.
표시하지 않으려면. ''/cgi-bin/runcommand.sh?random= "+ Math.floor (Math.random() * 1000) +"& cmd = 254,124,1r10t300 "' – cfs
아니요, 그건 내 게이트웨이 용 API의 일부입니다. 우리는 백엔드에서 임의의 숫자를 추출합니다. – Poodimizer
파이어 폭스/크롬이 "전송하는"(숫자의 그룹화) 것을 결정하는 방법은 무엇입니까? – Rob