Joined: Fri Jun 26, 2009 5:50 am Posts: 23 Has thanked: 0 time Have thanks: 1 time
Hi, The keystone of AJAX is the XMLHttpRequest object.
All new browsers use the built-in JavaScript XMLHttpRequest object to create an XMLHttpRequest object (IE5 and IE6 uses an ActiveXObject).
Let's update our "testAjax.htm" file with a JavaScript that creates an XMLHttpRequest object: <html> <body>
<script type="text/javascript"> function ajaxFunction() { var xmlhttp; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } } </script>