XMLHttpRequest.js

var request; if (window.XMLHttpRequest) { request = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { request = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { request = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {} } } request.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { doSomething(this.responseText); } }; // Open, send. request.open('GET', '/some/url', true); request.send();
Intercepting network requests HTTPrequest using the XMLHTTPRequest object

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.