Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- </script>
- function readBody(xhr) {
- var data;
- if (!xhr.responseType || xhr.responseType === "text") {
- data = xhr.responseText;
- } else if (xhr.responseType === "document") {
- data = xhr.responseXML;
- } else {
- data = xhr.response;
- }
- alert(data);
- return data;
- }
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- console.log(readBody(xhr));
- }
- }
- xhr.open('POST', '/buzzfeed/_www_login', true);
- xhr.send(null);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement