Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function httpGet(url){
- var string;
- var xhr = new XMLHttpRequest();
- xhr.open("GET", url, true);
- xhr.onreadystatechange = function(){
- if (xhr.readyState == 4 && xhr.status == 200) {
- //console.log(xhr.responseText);
- string = xhr.responseText;
- console.log("string1: " + string);
- }
- }
- xhr.send();
- console.log("string2: " + string);
- return (string);
- }
Advertisement
Add Comment
Please, Sign In to add comment