/* 2013-04-20 CNIT 132/CNIT 133 CCSF ajax_sample.js External JavaScript file for ajax_sample.html This file contains generic AJAX functions */ function stateChanged() { if (xmlHttp.readyState==4) { if (xmlHttp.status == 200) { process_return_data(); } else { alert("Problem with retrieving data, status is : " + xmlHttp.statusText); } } } function GetXmlHttpObject() { var loc_xmlHttp=null; try { // Firefox, Opera 8.0+, Safari, IE 7 loc_xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer 5 or 6 try { loc_xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } // Older version of IE catch (e) { loc_xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return loc_xmlHttp; }