//Bootstrap模态框(局部)
<divclass="modalfade"id="orderDetail">
<divclass="modal-dialog">
<divclass="modal-content">
<divclass="modal-header">
</div>
<divclass="modal-body">
<tableclass="table">
<tr>
<td>名称</td>
<td>原价</td>
</tr>
</table>
</div>
<divclass="modal-footer">
</div>
</div>
</div>
/**
*查看数据详情
*@黑眼诗人<www.chenwei.ws>
*/
functionorderDetail(order_no)
{
//1.先清空模态框数据
$('#orderDetail').find('tr').first().nextAll().remove();
//2.外部插入
varorder_no=order_no;
$.post(base_url+'?d=admin&c=orders&m=ajax_order_detail',{order_no:order_no},function(data){
//数据的格式如:[{no:123,old:abc},{no:234,old:def},{no:345,old:ghi}]
varobj=eval('('+data+')');
$.each(obj,function(i,n){
vartr=$('#orderDetail').find('tr').last();
tr.after("<tr><td>"+n['organize_name']+":"+n['cate_name']+"--"+n['course_name']+"</td><td>"+n['old_price']+"</td><td>"+n['sale_price']+"</td></tr>");
});
});
}