I have JSON
like this
var myVariable=[{"items": "SOFT TOUCH AVOCADO 125 ML x 6D","descriptions": "100mg","umo": "CTN","qty": 1,"price": 0,"lineamount": 0,"customerid": "ANG001","tdate": "11:0:2015","orderId": "Himansu12:9:707","bookorder": "ABCANG00197","FOC": 1}];
But We need JSON like this
var stringtwo ="[{\"items\": 19760,\"descriptions\": 7,\"umo\": 18377,\"qty\":8,\"price\":8,\"lineamount\": \"22\" ,\"customerid\": 1960,\"tdate\": 7,\"orderId\": 1377,\"bookorder\":7,\"FOC\":7 }]";
so Please any one guide me how to convert JSON (myVaiable) to JSON (stringtwo).We Try to POST data to server. Webservice developed by .NET
.SO We need POST JSON (stringtwo).But We Get JSON (myVaiable).
$.ajax({
url:'http://183.82.0.221:1234/MyService.svc/PostOrderData/'+stringone+','+stringtwo+'',
dataType:'jsonp',
type:'get',
cache:false,
timeout: 2000,
error: function(x, t, m) {
if(t=="timeout") {
alert("this app need internet connection so Please connect net first ");
} else {
//alert(t);
}},
success:function(data) {
debugger;
alert(data);
console.log(data);
},
});
We tried JSON data post to Server.but we got 400 bad request.