How to Create an AJAX object for various browsers

<script type="text/javascript">

function ajaxDataGet(){

var ajaxObject;  //the variable that will store the object

try {

   // Firefox, Safari, Chrome, Opera, Internet Explorer 7+

            ajaxObject = new XMLHttpRequest();

     }  catch (e) { 

         // Internet Explorer 5 & 6

      try {

        ajaxObject = new ActiveXObject("Microsoft.XMLHTTP");   

          } catch (e){

          //if AJAX is not supported at all

      alert("Your browser does not support AJAX!! ");

      return false;

      }

   }

}

</script>


Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

Make sure to activate your subscription by clicking on the activation link sent to your email