javascript - Send data to server using ajax call -


jquery.ajax({ url:"http://192.168.0.74:8080/pimsdesign/jsonrequesthandler" , type: "post", data: {name: "amit", id:1 }, datatype: "json", beforesend: function(x) { if (x && x.overridemimetype) { x.overridemimetype("application/json;charset=utf-8"); } }, success: function(result) { navigator.notification.alert(result); }         }); 

by using above code sending json data server server not data
how solve it?

try data: {name: "amit", id:1 }, => data: json.stringify({name: "amit", id:1 }),

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -