jquery 序列化
2016-06-27 11:00
405 查看
//生成发件人Json信息 function buildSenderInfoJson() { var sendName = $("#SendName").val(); var sendMobile = $("#SendMobile").val(); var sendAddress = $("#SendAddress").val(); var sendMail = $("#SendMail").val(); var sender = { Name: sendName, Mobile: sendMobile, Mail: sendMail, Address: sendAddress }; $("#SenderInfo").val(JSON.stringify(sender)); }
//生成货物Json信息 function buildGoodsInfoJson() { var array = new Array(); $(".tb_goods .tr_data").each(function (i, e) { var goodsCNName = $(e).find(".GoodsCNName").val(); var goodsENName = $(e).find(".GoodsENName").val(); var goodsCount = $(e).find(".GoodsCount").val(); var price = $(e).find(".Price").val(); var currencyType = $(e).find(".CurrencyType").val(); var buyShopUrl = $(e).find(".BuyShopUrl").val(); var goodsCustomsNo = $(e).find(".GoodsCustomsNo").val(); var goods = { GoodsCNName: goodsCNName, GoodsENName: goodsENName, GoodsCount: goodsCount, Price: price, CurrencyType: currencyType, BuyShopUrl: buyShopUrl, GoodsCustomsNo: goodsCustomsNo, }; array.push(goods); }); $("#GoodsModelJosn").val(JSON.stringify(array)); }
相关文章推荐
- jQuery设计思想
- jquery获取select 选中的options
- jQuery延迟加载(懒加载)插件 – jquery.lazyload.js
- jquery学习笔记1——选择器
- jquery实现抽屉式特效
- Jquery版本冲突
- jQuery实现每隔几条元素增加1条线的方法
- JS(含JQuery)一些好插件网站(非常全面)
- jQuery实现查找链接文字替换属性的方法
- jQuery实现点击网页内按钮,实现网页内灯光的亮灭
- 含有中文字符的json对象通过jquery提交到mongoose web的乱码问题
- jQuery梳理之Ajax
- jQuery梳理之表单
- jQuery实现查找链接文字替换属性的方法
- jQuery实现每隔几条元素增加1条线的方法
- Jquery和BigFileUpload实现大文件上传及进度条显示
- HTML5 jQuery图片上传前预览功能
- 引用新浪、Google、微软的CDN加载jQuery
- Jquery
- jQuery Lightbox图片放大预览