/ Published in: JavaScript

Make a simple XHR Request:
get(url, function(resp)(){ window.alert(resp); });
Source is minified.
get(url, function(resp)(){ window.alert(resp); });
Source is minified.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function get(b,a){var c=(window.XMLHttpRequest)?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");c.onreadystatechange=function(){if(c.readyState==4&&c.status==200){a(c.responseText)}};c.open("GET",b,true);c.send()};
Comments
