/************************************************** XML HTTP Messaging for Client server Communication ****************************************************/ function getResponse(url,queryString, postMethod) { try{ try { xmlHttp = new XMLHttpRequest() } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { xmlHttp = false; } } if (!xmlHttp) return null; //xmlHttp.overrideMimeType("text/xml"); xmlHttp.open(postMethod, url, false); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.send(queryString); return (xmlHttp.responseText+""); } catch (e) { return e.message; } } /************************************************************************* Loading XML document using XML HTTP messaging to parse xml nodes, compatible for both Mozilla and IE ****************************************************************************/ function getXMLDoc(url,queryString,postMethod) { var xmlDoc; var moz = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined'); if (moz) { try { var parser = new DOMParser(); xmlDoc = parser.parseFromString(getResponse(url,queryString,postMethod),"text/xml"); xmlDoc.async=false; } catch(e) { alert('Error : '+e); } } else { try { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.loadXML(getResponse(url,queryString,postMethod)); } catch(e) { alert('Error : '+e); } } return xmlDoc; }