function getXMLObject() { var xmlHttp = false; try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP") // For Old Microsoft Browsers } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP") // For Microsoft IE 6.0+ } catch (e2) { xmlHttp = false } } if (!xmlHttp && typeof XMLHttpRequest != 'undefined') { xmlHttp = new XMLHttpRequest(); //For Mozilla, Opera Browsers } return xmlHttp; } var xmlhttp = new getXMLObject(); function ajaxFunction(a,b,c) { try { if(xmlhttp) { xmlhttp.open("POST","makeConfirm.jsp?email="+c,true); xmlhttp.onreadystatechange = handleServerResponse; xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send(); } } catch (e) { } } function handleServerResponse() { if (xmlhttp.readyState == 4) { if(xmlhttp.status == 200) { document.getElementById("confirmEmail").style.visibility = 'hidden'; document.getElementById("conFirmEmailDiv").innerHTML=xmlhttp.responseText; //Update the HTML Form element } else { document.getElementById("confirmEmail").style.visibility = 'hidden'; document.getElementById("conFirmEmailDiv").innerHTML = ''; } } }