Hello all,
I have the following javascript, or to be more accurate AJAX because it connects to a database and updates a table made to tabulate votes. It is basically a script that takes the unique ID of a picture and passes it onto the database to update whether people voted LIKE or NOT LIKE on it... the problem is when the page loads and a vote is pressed, it only works once... it will not work again on another picture on the same page, even though it has a different unique ID which is passed onto the php script... I am not the best at javascript so i am hoping only a little tweak will result in it being able to be utilized by every pic on the page.

<script type="text/javascript">
function showUser(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
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 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML='Thanks';

}
}
xmlhttp.open("GET","vote.php?q="+str,true);
xmlhttp.send();
}
</script>