$(function() {
	var username = $("#username").val();
	var comment = $("#content").val();
	var itemid = $("#itemid").val();
	$.get("<{$home}>/comment.php", {username:username, comment:comment, itemid:itemid}, function(data){
		switch(data){
			case 0:
				alert("发表评论成功！");
				break;
			case 1:
				alert("文章ID未提供！");
				break;
			case 2:
				alert("评论内容未提供！");
				break;
			case 101:
			case 102:
				alert("验证码错误！");
				break;
			default:
				alert("抱歉，发生错误！");
		}
	});
});