当前位置: 代码迷 >> Web前端 >> dwr回调和异常提示的格式
  详细解决方案

dwr回调和异常提示的格式

热度:67   发布时间:2012-11-22 00:16:41.0
dwr回调和错误提示的格式
FileManager.bindIp(setip,{
			callback: function(data){
				closeSetip();
				tipLayer.hideBox(1);
				msgLayer.hideBox(1);
				if(data){
					bindIp = setip;
					$('#setip_index').val(bindIp);
					msgLayer.showBox(0,1,function(thisLayer){
						var text = thisLayer.find("span");
						$(text).attr("class","success");
						$(text).text("IP绑定成功");
						setTimeout(function(){msgLayer.hideBox(1)},1000);
					});
				}else{
					$('#setip_index').val(bindIp);
					msgLayer.showBox(0,1,function(thisLayer){
						var text = thisLayer.find("span");
						$(text).attr("class","normal");
						$(text).text("IP绑定失败");
						setTimeout(function(){msgLayer.hideBox(1)},1000);
					});
				}
					$('#setipId').attr("class","");
				},
				errorHandler: function() {
					$('#setip_index').val(bindIp);
					closeSetip();
					msgLayer.showBox(0,1,function(thisLayer){
						var text = thisLayer.find("span");
						$(text).attr("class","normal");
						$(text).text("IP绑定失败");
						$('#setipId').attr("class","");
						setTimeout(function(){msgLayer.hideBox(1)},1000);
					});
				}
			});

?

  相关解决方案