getBoundaries.php
Код: Выделить всё
Код: Выделить всё
function anyname(){
var xhttp;
var query = "tid=1&pid=1";
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
var temp = xhttp.responseText;
if (temp == ""){
console.log("ein leerer string");
}
else{
for (i = 0; i < temp.length; i++){
console.log(temp.charCodeAt(i));
}
}
}
}
xhttp.open("POST", "getBoundaries.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(query);
}
Выходные данные console.log с $t="t" были 116, 32, 10, 32.
Итак, мой вопрос: ПОЧЕМУ не возвращается пустая строка как ответТекст? Где добавлены эти дополнительные 3 символа? Мое предположение: php-команда echo добавляет эти три символа.
Есть предложения?
Подробнее здесь: https://stackoverflow.com/questions/348 ... characters
Мобильная версия