I am trying to send a request to a server and expecting to get back XML script. Will it be saved in response text only ? if yes its somehow not working
<html>
<head>
</head>
<body>
<script type = "text/javascript">
var name="";
function note() {
name=first.query.value;
}
document.write(name);
function function1(){
var xmlHttp;
try {
xmlHttp = new XMLHttpRequest();
}
catch(e) {
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e) {
alert("AJAX dosent work on your browser");
return false;
}
}
}
xmlHttp.onreadystatechange = function() {
if(xmlHttp.readyState==4){
document.first.answer.value=xmlHttp.responseText;
}
}
var url="http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=YahooDemo&query=";
var question=document.first.query.value;
url=url+question;
xmlHttp.open("GET",url,true);
xmlHttp.send(NULL);
return;
}
</script>
<form name="first">
Question : <input type="text" name="query" value="Type your question here" onkeyup="note()">
<input type="text" name="answer">
<input type="button" name="button1" value="Press" onclick="function1()">
</form>
Please help its very urgent!!