XMLHttpRequest.response

XMLHttpRequest.response - дані отримані від сервера.

Синтаксис:

XMLHttpRequest.response;

Параметри:

XMLHttpRequest - об'єкт XMLHttpRequest.

Опис:

response властивість об'єкту XMLHttpRequest яка повертає дані отримані від сервера. Формат даних залежить від типу відповіді сервера responseType:

Приклад:

var xhr = new XMLHttpRequest(); xhr.open('GET', '', true); xhr.onload = function(){ alert( this.response ); }; xhr.send(null); var xhr = new XMLHttpRequest(); xhr.open('GET', ''); xhr.onload=function(){ alert("Завантажено. Дані: "+xhr.response); } xhr.send(null);