All pastes #430740 Raw Edit

Something

public javascript v1 · immutable
·published 2007-04-09 06:40 UTC
rendered paste body
	function add_comment(cID,email,comment){		var XHR = false;				if(window.XMLHttpRequest){			XHR = new XMLHttpRequest();		}else if(window.ActiveXObject){			XHR = new ActiveXObject("Microsoft.XMLHTTP");		}						if(XHR){			XHR.open("POST","comment.php",true);			XHR.setRequestHeader('Content-Type','application/x-www-form-urlencoded');						XHR.onreadystatechange = function(){				if(XHR.readyState == 4 && XHR.status == 200){					var pass = XHR.responseText;					tPass = pass.replace(/^\s+|\s+$/g, '');						if(tPass == "yes"){							alert("Blah");							goCom =  "yes";						}else{							alert("else");							goCom = "nope";						}				}			}						XHR.send("action=add&cID="+encodeURI(cID)+"&email="+encodeURI(email)+"&comment="+encodeURI(comment));		}	}