var xmlHttp; function createXmlHttp(){ if (window.ActiveXObject){ xmlHttp = new ActiveXObject('Microsoft.XMLHTTP'); if (xmlHttp == null){ xmlHttp = new ActiveXObject('Msxml2.XMLHTTP'); } } else { xmlHttp = new XMLHttpRequest(); } } function postMessage(url,content,callback){ createXmlHttp(); xmlHttp.open('post',url); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); xmlHttp.onreadystatechange=callback; xmlHttp.send(content); }