// * // * ajax.js // * // * Andrew Matthews // * DMR Limited // * December 2005 // * // * vers 1.1 AJM 06/12/2005 // * vers 1.2 AJM 06/12/2005 Append the noCache variable to the url // * var requestObject, goodBrowser; // only the first 4 fields are mandatory function getUrl(method, url, async, callback, content, usrname, pword) { if (arguments.length < 4) return 2; if (window.XMLHttpRequest) { requestObject = new XMLHttpRequest(); goodBrowser=1; }else{ if (window.ActiveXObject) { goodBrowser=0; try { requestObject = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { requestObject = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { requestObject = false; } } }else requestObject=false; } if (requestObject) { requestObject.onreadystatechange = callback; // Avoid cache hits by appending a variable with the epoch milliseconds in it var now=new Date(); if (url.indexOf("?") == -1) url=url + '?noCache=' + now.getTime(); else url=url + '&noCache=' + now.getTime(); requestObject.open(method, url, async, usrname, pword); if (goodBrowser && !content) content=null; requestObject.send(content); return 0; }else return 1; }