Pull to refresh

Comments 1

if (this.readyState == 4) {
  if (this.status == 200) {
    if (this.responseText != null) {
      document.getElementById("sw_an_data").innerHTML = this.responseText;
    }
  }
}

Мне одному этот код глаз резанул?

if (this.readyState == 4 && this.status == 200 && this.responseText != null) {
  document.getElementById("sw_an_data").innerHTML = this.responseText;
}

Полный эквивалент и не режет глаз.

Ещё можно было б использвать уж fetch.

Sign up to leave a comment.