<html>
<head>
<script type="text/javascript">
var xmlhttp = false;
function CreateXMLHttp(){
try{
xmlhttp = new XMLHttpRequest();
}
catch (e){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (failed){
xmlhttp = false;
}
}
}
return xmlhttp;
}
xmlhttp = CreateXMLHttp();
xmlhttp.open("post","a.html",true);
xmlhttp.onReadyStateChange = getResult;
xmlhttp.send();
function getResult(){
if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
alert(xmlhttp.responseText);
}
}
</script>
</head>
</html>
<html>
<head>
<script type="text/javascript">
var xmlhttp;
function showHint(){
alert(xmlhttp+"1");
alert((undefined == xmlhttp)+"2");
alert((null == xmlhttp)+"3");
alert(("" == xmlhttp)+"4");
return xmlhttp;
}
</script>
</head>
<body>
<form>
First Name:<input type="text" id="txt1" οnkeyup="showHint()" />
</form>
<p>Suggestions: <span id="txtHint"></span></p>
</body>
</html>
<head>
<script type="text/javascript">
var xmlhttp = false;
function CreateXMLHttp(){
try{
xmlhttp = new XMLHttpRequest();
}
catch (e){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (failed){
xmlhttp = false;
}
}
}
return xmlhttp;
}
xmlhttp = CreateXMLHttp();
xmlhttp.open("post","a.html",true);
xmlhttp.onReadyStateChange = getResult;
xmlhttp.send();
function getResult(){
if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
alert(xmlhttp.responseText);
}
}
</script>
</head>
</html>
<html>
<head>
<script type="text/javascript">
var xmlhttp;
function showHint(){
alert(xmlhttp+"1");
alert((undefined == xmlhttp)+"2");
alert((null == xmlhttp)+"3");
alert(("" == xmlhttp)+"4");
return xmlhttp;
}
</script>
</head>
<body>
<form>
First Name:<input type="text" id="txt1" οnkeyup="showHint()" />
</form>
<p>Suggestions: <span id="txtHint"></span></p>
</body>
</html>