码迷,mamicode.com
首页 > Web开发 > 详细

js发送json数据至后台

时间:2018-11-28 14:03:54      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:console   nstat   div   col   gif   color   app   log   1.0   

将下加入js中去

        function test() {
                    var obj=new Object();
                    obj.VERSION="V1.0";
                    obj.TIMESTAMP="20161011125200";
                    obj.SEQNO="CP1476161520059";
                    obj.APPID="test01_api";
                    obj.SECERTKEY="73f02be36ed6201f4ffa30cfd4fbca4e";
                    var object = new Object();
                    object.ORDERID = "147615503234693";
                    object.EXTORDER = "17";
                    object.STATUS = "充值成功";
                    object.CODE = "00";
                    object.CHECKTIME = "20161011110658000";
                    object.PRICE = "100";
                    var object2 = new Object();
                    object2.CONTENT=object;
                    var object3 = new Object();
                    object3.MSGBODY=object2;
                    object3.HEADER=obj;
                    $.ajax({
                        url:"http://localhost:8080/zn_shop/cp/returnstatus",
                        contentType:"application/json",
                        data:JSON.stringify(object3),
                        dataType:"json",
                        type:"POST",
                        success:function (data) {
                            console.log(data);
                        }
                    });
                }
                test();

 

js发送json数据至后台

标签:console   nstat   div   col   gif   color   app   log   1.0   

原文地址:https://www.cnblogs.com/dztHome/p/10031657.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!