Slide 47
Slide 47 text
AJAX a.php -> b.php -> c.php
var xhr = new XMLHttpRequest();
xhr.open('GET', 'a.php', true);
xhr.onreadystatechange(function(http) {
if(http.readyState == 4 && http.status == 200) {
xhr.open('GET', 'b.php', true);
xhr.onreadystatechange(function(http) {
if(http.readyState == 4 && http.status == 200) {
xhr.open('GET', 'c.php', true);
xhr.onreadystatechange(function(http) {
if(http.readyState == 4 && http.status == 200) {
// ...
}
})
xhr.send();
}
})
xhr.send();
}
});
xhr.send();