I'm doing a post with jQuery
$( "#input" ).focusin(function() {
$(document).keyup(function(e){
if(e.keyCode==13)
{
$.post("other.jsp",{var:var})
.done(function(data){
});
}
}
Then the other jsp execute a query and returns:
out.println(rsvar.getString("name"));
out.println(rsvar.getString("lastname"));`
My code works... But the Data is retrieved in a single String and I want to append rsvar.getString("name")
in an input like a value and rsvar.getString("lastname");
in other input.
$("#name").val(rsvar.getString(name));
<input id="name" >
A friend told me that he uses json_encode + php and iterates the data like data[i].name
So he can split the data...
What library can I use to solve my problem?