/** * funzioni ajax * * * versione 1.0.0 09-nov-2006 * autore Rosso Maurizio */ // crea l'oggetto request appropriato (dipendente dal tipo di browser) function createXMLHttpRequest() { if (window.XMLHttpRequest){ // If IE7, Mozilla, Safari, etc: Use native object try { return new XMLHttpRequest(); } catch(e) {} } else if (window.ActiveXObject){ // ...otherwise, use the ActiveX control for IE6 try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {} // ...otherwise, use the ActiveX control for IE5.x try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } else { alert("XMLHttpRequest not supported"); return null; } } /** * Restituisce la versione dell'encoding iso in funzione del sistema operativo utilizzato. * In particolare: ISO-8859-1 per Windows98 (altrimenti le chiamate ajax non funzionano) * ISO-8859-15 per tutti gli altri sitemi operativi */ function getIso(){ var infoOS=navigator.userAgent.toLowerCase(); var isWin98 = ((infoOS.indexOf("win98")!=-1)||(infoOS.indexOf("windows98")!=-1)||(infoOS.indexOf("windows 98")!=-1)); var isoVersion = "ISO-8859-15"; if (isWin98){ isoVersion="ISO-8859-1" } return isoVersion; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // bn - FINE function callAjaxAutocompletamento( parID, parTipo ){ // chiamo ajax se: var debugStep = -1; if( debugStep >= 1 ){ alert ( "Hullo ajax.js.callAjaxAutocompletamento:"+parID+"-"+parTipo+"." ); } //questo lo faccio comunque xche' chiamata sempre da impostaDatiCorrispondenza per nuovo, modica o cancella //removeAllOptionsId(parIdSog); parValore = trim(document.getElementById(parID).value); if( debugStep == 1 ){ alert ( "cerco:'"+ parValore +"'" ); } if (parValore!=""){ var arrayParameter = new Array(); arrayParameter[0] = parTipo; arrayParameter[1] = parValore + "~A~"; arrayParameter[2] = "AjaxDP" ; if( debugStep == 1 ){ alert ( "chiamo ajax!" ); } ajaxRequest(arrayParameter); } if( debugStep >= 1 ){ alert ( "Bye ajax.js.callAjaxAutocompletamento" ); } } // bn - FINE /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////