All modern web browsers provide an XMLHttpRequest
class you can instantiate in your code, which you can use to issue asynchronous calls to obtain content over HTTP. You'll create one or more of these in your client-side JavaScript using the new
operator.
You'll want to create an instance of this class early on in your JavaScript after the page loads, as shown in the following code:
function doAjax() { var xmlhttp; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } }