获取form表单数据

var modelObj = {};
var modelFieldsArray = $('#AddMusic').serializeArray();
$.each(modelFieldsArray, function () {
modelObj[this.name] = this.value;
});

modelObj.MusicUrl = musicApp.commonKit.upLoadMng.fileMusicUrl;
modelObj.ImgUrl = musicApp.commonKit.upLoadMng.fileImgUrl;
var modelStr = JSON.stringify(modelObj);
var requestModel = {};
requestModel.method = "MusicCreate";
requestModel.modelstr = modelStr;

原文地址:https://www.cnblogs.com/liuqiyun/p/9323446.html