1.数组转字符串
companyindustry = new Array(); $(".selectindustry").each(function(index, el) { companyindustry.push($(this).val()); }); companyindustryid = companyindustry.join(",");
2.对象转json字符串
var taxratingarr = []; $(".taxrating").each(function(i){ taxratingarr[i] = {'year':$(this).data('year'),'rank':$(this).val()}; }) taxratings = JSON.stringify(taxratingarr);
本文为看恩吧原创文章,转载无需和我联系,但请注明来自knsay.com