当前位置: 代码迷 >> JavaScript >> json应用
  详细解决方案

json应用

热度:136   发布时间:2012-08-17 02:08:34.0
json使用
	$(function(){
		$("#istoCancel").click(function(){
			$.getJSON("${ctx}/learning/webexSystem/webex/remove/${runclassid}", function(json){
				  if(json.result==false){
					  alert(json.message);
					  return ;
				  }
				  window.location.reload();
			});
		});
	});




@RequestMapping(value = {"webex/remove/cancelPage/{runclassid}"})
	public String toCancelPopPage(Model model,@PathVariable String runclassid){
		model.addAttribute("runclassid",runclassid);
		return "learning/webex/cancelPop";
	}


@RequestMapping(value = {"webex/remove/{runclassid}"})
	@ResponseBody
	public String removeClassInfo(@PathVariable String runclassid){
		Map<String,Object> backParam=new HashMap<String,Object>();
		try{
			this.teachRuntimeClassroomService.removeRunClass(runclassid);
			backParam.put(MessageConstents.tip_key_result, true);
		}catch(Exception ex){
			backParam.put(MessageConstents.tip_key_result, false);
			backParam.put(MessageConstents.tip_key_message, MessageConstents.FAIL_OPERATOR_USER);
		}
		JSONObject json = JSONObject.fromObject(backParam);
		return json.toString();
	}


//删除 提示层
			$('.overlay_delete').live("click",function(e) {
				e.preventDefault();
				var runclsid=$(this).attr("clsid");
				$.fn.nyroModalManual({
					width:400,
					title:"取消操作",
					url: '${ctx }/learning/webexSystem/webex/remove/cancelPage/'+runclsid+".ajax"
				});
				return false;
			});



  相关解决方案