$(function(){

	/*var uname = localStorage.uname;
	if(uname!=null && uname!=''){
		$("#rname").html(uname);
	}*/

	$("#submitBtn").click(function(){

		var lwId = $("#lwId").val();
		var rname = $("#rname").val();
		var replay = $("#replay").val();

		var hostId = localStorage.hostId;

		var params = {
				lwId:lwId,
				rname:rname,
				replay:replay,
				userId:hostId
		};
		
		$.ajax({
			url: HttpRest+"leaveword/update.shtml", 
			type: "post", 
			dataType: "json",
			data:$.toJSON(params),   
			contentType:"application/json",
			success: function(data) { 
				if(data.code=='01'){
					layer.confirm('保存成功！是否关闭窗口?', function(index) {
						parent.grid.loadData();
						parent.layer.close(parent.pageii);
					});
				}else{
					layer.msg('保存失败！',{icon: 5});
				}
			}
		});
	});

	onloadurl();
});