How To Check That Your Browser support ajax

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Untitled Page</title>
<script type = "text/javascript">
function GetXmlHttpObject() {
 var xml_Http = null;
 try {
    // Firefox, Opera 8.0+, Safari
    xml_Http = new XMLHttpRequest();
    }
 catch (e) {
    // Internet Explorer
    try {
       xml_Http = new ActiveXObject("Msxml2.XMLHTTP");
       }
    catch (e) {
       xml_Http = new ActiveXObject("Microsoft.XMLHTTP");
       }
    }
 return xml_Http;
 }
function check() {
 window.xmlHttp = GetXmlHttpObject();
 if (window.xmlHttp == null) {
    alert ("Your browser does not support AJAX!");
    return null;
    }
 else {
    alert("Your Browser support ajax");
    }
 }

</script>
</head>
<body onload="check();">
</body>
</html>

No comments:

Post a Comment