1. 程式人生 > >js表單提交到後臺對象接收

js表單提交到後臺對象接收

view external install mode cti body pin target 下單

$.extend({
StandardPost:function(url,args){
var form = $("<form method=‘post‘ target=‘_blank‘></form>"),
input;
form.attr({"action":url});
$.each(args,function(key,value){
input = $("<input type=‘hidden‘>");
input.attr({"name":key});
input.val(value);
form.append(input);
});
form.appendTo(‘body‘).submit().remove();
}
});

下單點擊按鈕觸發事件:
$("#btn_test").click(function () {
var data = {
maxQuotationNo:"",
maxPrice:,
salePrice:10000.00,
dealerId:,
buyerId:
};
$.StandardPost(‘http://***/***/**/toDisposePage‘, data);
});

後臺取值:post 對象接收
@RequestMapping(value = "/printAgreement", method = RequestMethod.POST)
public ModelAndView printAgreement(ModelAndView modelAndView, ReceiptInstallmentVO vo ) {



js表單提交到後臺對象接收