0

Hellow i have the following files

body.html
data.php
js3.js

I am trying to create an ajax search but it doesnt work....:(

The js code is:

var xmlHttp
function finding(str){
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }catch (e) {
	try {
 xmlhttp = new XMLHttpRequest()
  }catch (e) {
   alert("Browser does not support HTTP Request")
return
  }
var url="data.php"
url=url+"?productname="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}}}
function stateChanged()
{
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("result").innerHTML=xmlHttp.responseText
}
}
function stateChanged()
{
if(xmlHttp.readyState==4|| xmlHttp.readyState=="complete")
{
document.getElementById("result").innerHTML=xmlHttp.responseText
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
}

The html code containes:

<script src="js3.js"></script>
</head>

<body>
<form>
search: 
<input type="text" size="30" onkeyup="finding(this.value)"/>
</form>
<p><div id="Result"></div>
</p>
</body>
</html>

Pls need some help!!!tnx

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by garevn
0

ok i fixed that it was upper case-lowercase issue tnx anyway

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.