ajax calling some other javascript
<p>i need to call text.php on clicking the table content but its returning some other file in xmlhttp.responseText a page with in that is displaying. its returning some page even though i kept blank at xmlhttp.open </p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type='text/javascript'&gt;
function text1()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)
{
//alert(xmlhttp.responseText);
  document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","text.php",true);
xmlhttp.send();

}
&lt;/script&gt;
&lt;/head&gt;


&lt;?php
echo "&lt;body&gt;";
echo "&lt;table&gt;";
echo "&lt;h2&gt;".$_GET[rep_name]."\n Repository Content&lt;br&gt;&lt;/h2&gt;";
$l=shell_exec("ls /var/www/users/$_COOKIE[user]/$_GET[rep_name]");
$urlarray=split("\n",$l);


for($i=0;$i&lt;count($urlarray)-1;$i++)
{
if(is_dir($urlarray[$i]))
{
echo "&lt;tr&gt;&lt;td&gt;&lt;img src='../icons/folder.png'/&gt;&lt;/td&gt;".$urlarray[$i]."&lt;/a&gt;&lt;br&gt;";
}
else
{
echo "&lt;tr&gt;&lt;td&gt;&lt;img src='../icons/text.png'/&gt;&lt;/td onclick='text1()'&gt;"."&lt;td onclick='text1()'&gt;&lt;span  id='txtHint'&gt;&lt;/span&gt;".$urlarray[$i]."&lt;/td&gt;&lt;/tr&gt;&lt;br&gt;";
}
}
echo "&lt;/table&gt;";
//echo "";
echo "&lt;/body&gt;&lt;/html&gt;";
?&gt;
</code></pre>
