.value is a property not an function
You want to pass json use data of $.ajax
if response data is not JSON you can use $.parseJSON to convertit to JSON
Complete Code
<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: 'Json',
data:{
uname:uname,
password:password
},
success: function(data) {
$('#name').val(data.name);
$('#email').val(data.email);
}
});
});
});
</script>