获取form表单中提交的数据
第一种
var data = data.field;
优点:简洁,方便。
第二种
var json = {
id: $("#id").val(),
uploadType:$("#uploadType").val(),
name:$("#name").val(),
state:$("#state select").val(),
classify:$("#classify select").val(),
fileType:$("#fileType select").val(),
type2:$("#type2 select").val(),
courseTypeId: $("#courseTypeId").val(),
picture: $("#picture").val(),
price: $("#price").val(),
title: $("#title").val(),
lectuer: $("#lectuer").val(),
lectuerIntroduction: $("#lectuerIntroduction").val(),
courseHighlights: text1,
news: $("#news").val(),
catalog: $("#catalog").val(),
purchaseInstructions: $("#purchaseInstructions").val(),
};
优点:能够在页面确保各字段与后端接收数据类中字段对应。