Show result in alert box after sending data using xmlhttp.send()

Hello

I am making rating system and i wanna send value using xmlhttp.send(); and i wanna show my final result in alert box please help me this is my code

system work like this

first user click on this

<a href=“javascript: void(0)” title=“1 star out of 10” class=“one-star” onclick=“return one()” onfocus=“rating_submit(1)”>1</a>

this is my function

<script type=“text/javascript”>
function rating_submit(str)
{
if (str==“”)
{
document.getElementById(“ajaxuse”).innerHTML=“”;
return;
}
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(“ajaxuse”).innerHTML=xmlhttp.responseText;
}
}

xmlhttp.open("GET","rating.php?films=&lt;?php echo $$films; ?&gt;&film_name=&lt;?php echo $film_name; ?&gt;&film_id=&lt;?php echo $film_id; ?&gt;&username=&lt;?php echo $username; ?&gt;&rating="+str,true);
xmlhttp.send();

}
</script>

now i solve half of this problem by myself but one small appearing again

if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
//document.getElementById(“ajaxuse”).innerHTML=xmlhttp.responseText;
var abccc = xmlhttp.responseText;
alert(abccc);
}

alert box is showing many times like 4 to 5 times…
how can i remove this error