Line 6: Now we are getting into the guts of the function. To use XMLHttpRequest with Internet Explorer 5 we need to use an Active X object where as Mozilla based browsers, Opera and Safari support XMLHttpRequest directly. So we have to create a little conditional switch to ensure that the right method is used for the right browsers. We do this by fist creating a variable named x and checking for the existence of an ActiveX object using a conditional operator. If an activeX object is found then the statement uses the method for IE if not it skips over to using XMLHttpRequest that is used by the other modern browsers.
For Internet Explorer, if we wanted to, we could use try and catch JavaScript methods to create some conditional branches to implement version dependent instances of XMLHTTP. For example Msxml2.XMLHTTP.3.0. In the next tutorial, we will implement these methods because they also are useful for error catching.