In the above Javascript code, we tried three
times to make our XMLHttpRequest object. Our first attempt was :
- ajaxRequest = new XMLHttpRequest();
is for the Opera 8.0+, Firefox and Safari browser. If that
fails we try two more times to make the correct object for an
Internet Explorer with:
- ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
- ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");>
If that doesn't work, then they are using a very outdated
browser that doesn't support XMLHttpRequest, which
means it doesn't support Ajax.
Most likely though, our variable ajaxRequest will now
be set to whatever XMLHttpRequest standard the browser
use and we can start sending data to the server.
|