GIF89a php
Current File : /home/hencockfreshchic/public_html/app/js/saveComment.js
function saveComment(user_id,id)
{
	var msgg=$("#floatingTextarea").val();

	if(msgg=="")
	{
		alert("Enter message");
		$("#floatingTextarea").focus();
		return false;
	}

	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)
      {
      	window.location.href = ("profile.php?id="+id);
      }
      else
      {
      	var x = document.getElementById("snackbar");
	      	$("#snack_msgg").html("Unable to comment");
 			 x.className = "show";
  			setTimeout(function(){ x.className = x.className.replace("show", "Hello"); }, 3000);
      }	
	}
  };
  xmlhttp.open("GET","saveComment.php?user_id="+user_id+"&frnd_id="+id+"&msgg="+msgg,true);
  xmlhttp.send();
}