Dit is mijn eerste ajax oefening.
Alles werkt goed. Totdat ik het teste in FF en daar doet het niets...
<html>
<head>
<script type="text/javascript">
function ajaxFunction(){
var xmlHttp;
try{
//FF, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e){
//IE
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function(){
if (xmlHttp.readystate==4){
document.myForm.txt.value=xmlHttp.responseText;
}
}
xmlHttp.open('GET', 'justtesting.php', true);
xmlHttp.send(null);
}
</script>
</head>
<body>
<form name="myForm">
start: <input type="text" onKeyUp="ajaxFunction();"/>
<input type="text" name="txt"/>
</body>
</html>
761 views