/* Copyright(C) 2005,2006,2007 Salvatore Sanfilippo * All Rights Reserved. */ /* Browser compatibilty. * Tested with: * * Firefox 1.0 to 1.5 * Konqueror 3.4.2 * Internet Explorer 5.0 * internet Explorer 6.0 * internet Explorer 7.0 * * It should work also in Opera and Safari without troubles. */ // Create the XML HTTP request object. We try to be // more cross-browser as possible. function CreateXmlHttpReq(handler) { var xmlhttp = null; try { xmlhttp = new XMLHttpRequest(); } catch(e) { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } } xmlhttp.onreadystatechange = handler; return xmlhttp; } // An handler that does nothing, used for AJAX requests that // don't require a reply and are non-critical about error conditions. function DummyHandler() { return true; } // Shortcut for creating a GET request and get the reply // This few lines of code can make Ajax stuff much more trivial // to write, and... to avoid patterns in programs is sane! function ajaxGet(url,handler) { var a = new Array("placeholder"); for (var j=2; j