Hi, I am new to JSON. My question is how to pass JSON data to soothing web services via ajax?
Please help me.
I tried the following code, but I'm not sure about it
MY INDEX PAGE
<script type="text/javascript"> $(document).ready(function(){ var uname = document.getElementById("uname").value(); var password = document.getElementById("pwd").value(); $('#ok').click(function(){ $.ajax({ url:'http://localhost:8090/LoginAuthRWS/rest/orders', type:'post', dataType: 'Jsondemo', success: function(data) { $('#name').val(data.name); $('#email').val(data.email); var JSONObject= { "uname":uname, "password":password }; } }); }); }); </script>
json jquery rest ajax
Jagathesewaren kuppuraj
source share