Guest User

Untitled

a guest
Feb 17th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. const http = new XMLHttpRequest();
  2. http.open("GET", "https://ya.ru/index.php",true);
  3. http.send();
  4. http.onload = function(e){
  5. console.log(http.status);//выводит как положено
  6. }
  7. console.log(http.status);//выводит 0 т.е. неверный результат
  8.  
  9. const response = await fetch('https://ya.ru/index.php');
  10. console.log(response);
Add Comment
Please, Sign In to add comment