日期:2014-05-16 浏览次数:20752 次
<form id="orderAdPoint" action="">
<input type="hidden" class="input w100" id="point_id" name="pointId">
<input type="hidden" class="input w100" id="order_id" name="id">
<h4>广告预约</h4>
<table width="220px" height="100px" >
<tr>
<th>预约人</th>
<td>
<input type="text" name="orderPersonName" id="order_person_name"/>
</td>
</tr>
<tr>
<th>预约公司</th>
<td>
<input type="text" name="coName" id="order_co_name"/>
</td>
</tr>
<tr>
<td>
<button onclick="orderAdPoint(this.form);">确定</button>
<button onclick="unblockUI();">取消</button>
</td>
</tr>
</table>
</form>
function orderAdPoint(form){
	$(form).ajaxSubmit({
		url : 'orderAdPoint.do',
		dataType : 'json',
		type : 'post',
		cache:false, 
		success : function(data){/*不知道为什么,代码运行到这时进入后台,但是页面上的断点会跳到下面的error:function(){ alert("系统出错了!");},但是后台根本没有行完这是怎么会事*/
			if(data.result != 0){
				$.unblockUI();
				alert("预约成功");
				var adOrder = data.adOrder;
				$("#status"+point_id).html("预约中");
				$("#out_order_time"+point_id).html    (data.outOrderTime);
				$("#order_person_name"+point_id).html(adOrder.orderPersonName);
				$("#"+point_id).html('');
				}else{
					alert("没有找到预约人或预约失败!");
					$.unblockUI();
				}
				$("#orderAdPoint").clearForm(true);
			 },
			 error:function(msg) { 
			 		$("#orderAdPoint").clearForm(true);
			 		$.unblockUI();	
	    		    alert("系统出错了!"); 	
	  		 }
	   });
}
             error:function(msg) { alert(msg.responseText)/////////输出返回的内容看看是否标准模式的json
                   $("#orderAdPoint").clearForm(true);
                   $.unblockUI(); 
                    alert("系统出错了!");  
               }