Return to Snippet

Revision: 67708
at October 19, 2014 06:32 by geneticcode


Initial Code
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()};

Initial URL

                                

Initial Description
Make a simple XHR Request:

get(url, function(resp)(){ window.alert(resp); });

Source is minified.

Initial Title
XHR GET Request W/ Callback

Initial Tags
http, ajax

Initial Language
JavaScript