Using independent version conditions makes sense if you want to use a specific feature you know is supported by a particular version of XMLHTTP. In this instance however that isn't applicable so we can use the version independent method which is Microsoft.XMLHTTP. That will work on IE5 through to IE7. It also has the added benefit of keeping our code nice and lean. And we like lean code don't we!

Line 7: We check that either the Microsoft.XMLHTTP or XMLHttpRequest objects have been created through the usage of the previously named variable x.

Line 8: The onreadystatechange event is used to keep track of when the readystate of a document changes. In this statement we attach the event to Microsoft.XMLHTTP or XMLHttpRequest respectively by using the variable x.