Salve a tutti. io ho un problema con Ajax. Io ho una funzione JS per istanziare Ajax per un motore di ricerca. All'interno dell'altra pagina ne ho un altro, il primo motore non va e il secondo funziona.
riporto il codice

<FORM> ======== FORM 1 ========</FORM>
<script language=Javascript>
function Init_AJAX() {
try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {} //IE
try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {} //IE
try { return new XMLHttpRequest(); } catch(e) {} //Native Javascript
alert('XMLHttpRequest not supported');
return null;
};

function dochange(src, val) {
var req = Init_AJAX();
req.onreadystatechange = function () {
if (req.readyState==4) {
if (req.status==200) {
document.getElementById(src).innerHTML=req.respons eText;
}
}
};
req.open('GET', 'ajax.php?data='+src+'&val='+val);
req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=tis-620'); // set Header
req.send(null);

}
window.onLoad=dochange('form1_select',-1);
</script>

[....]

<FORM> ======== FORM 2 ========</FORM>
<script language=Javascript>
function dochange(src, val) {
var req = Init_AJAX();
req.onreadystatechange = function () {
if (req.readyState==4) {
if (req.status==200) {
document.getElementById(src).innerHTML=req.respons eText;
}
}
};
req.open('GET', 'ajax_2.php?data='+src+'&val='+val);
req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=tis-620');
req.send(null);

}
window.onLoad=dochange('form2_select',-1);

</script>
I due form sono indipendenti. Il secondo form funziona il primo no. Qulcuno ha un'idea?

grazie a tutti