GIF89a php
Current File : /home/hencockfreshchic/public_html/js/deleteCartItem.js
function deleteCartItem(prod_sr,prod_price,total_amount){
	var cartCount=parseInt($("#cartCount").text());
	var total=parseInt($("#total_amount").text())-prod_price;

	if (window.XMLHttpRequest) {
            xmlhttp = new XMLHttpRequest();
        } else {          
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } 
  xmlhttp.onreadystatechange=function() 
   {
    if (this.readyState==4 && this.status==200) 
	{
      if(this.responseText==1)
      {
      	document.getElementById(prod_sr).style.display = "none";
      	var newCount=cartCount-1;
      	$("#cartCount").text(newCount);      	
      	$("#total_amount").text(total);
        window.location.reload();
      }
      else if(this.responseText==0)
      {
      	alert("Error: Unable to delete cart item");
      }
	}
  };
  xmlhttp.open("GET","deleteCartItem.php?prod_sr="+prod_sr,true);
  xmlhttp.send();
}