﻿
function SetFriend(userName, friendName, obj)
{
    var objs = $(obj);
    var strpost = "{'friendName':'"+friendName+"', 'userName':'"+userName+"'}";
    var filePath = "/WebService/WsMyFriend.asmx/SetFriend";
    
    new Ajax.Request(filePath + '?utc=' + ((new Date().getTime()).toString()), {
		    method:'post',
		    contentType:'application/json',
		    asynchronous:true,
		    postBody:strpost,
		    onSuccess: function(transport) {
			    SetFriendFin(objs);
		    },
		    onFailure: function() {
			    SetFriendFailure(objs);
		    }
	    });
}

// 获取投票信息
function SetFriendFin(objs){
    objs.innerHTML = "是好友";
}
// 获取投票信息
function SetFriendFailure(objs){
    objs.innerHTML = "失败";
}
