Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var xhr = new XMLHttpRequest();
- xhr.open("GET", "URL", true);
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- data = JSON.parse(xhr.responseText);
- alert(data);
- }
- }
- xhr.send();
- ||
- xhr.onreadystatechange = function() {
- if(xhr.readyState == 4 && xhr.status == 200) {
- alert(xhr.responseText);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment