var placeholder; function ajaxHelper(p_action, p_placeholder, p_postData) { placeholder = p_placeholder; xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Browser does not support HTTP Request"); return false; } xmlHttp.onreadystatechange=stateChanged1; xmlHttp.open("POST",p_action,true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", p_postData.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.send(p_postData); return false; } function stateChanged1() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { if (document.getElementById(placeholder) == null) { alert("Execution successful."); } else { document.getElementById(placeholder).innerHTML=xmlHttp.responseText; return false; } } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }