[READ-ONLY] Mirror of https://github.com/probablykasper/playground. playground.kasper.space
0

Configure Feed

Select the types of activity you want to include in your feed.

playground / js2 / request.js
584 B 23 lines
1"use strict"; 2 3var myRequest; 4 5if (window.XMLHttpRequest) { 6 myRequest = new XMLHttpRequest(); 7} else if (window.ActiveXObject) { 8 myRequest = new ActiveXObject("Microsoft.XMLHTTP"); 9} 10 11myRequest.onreadystatechange = function() { 12 console.log("We were called!"); 13 console.log(myRequest.readyState); 14 if (myRequest.readyState == 4) { 15 var p = document.createElement("p"); 16 var t = document.createTextNode(myRequest.responseText); 17 p.appendChild(t); 18 document.getElementById("stuff").appendChild(p); 19 } 20}; 21 22myRequest.open("GET", "resources/simple.txt", true); 23myRequest.send(null);