I have javascript which calls a controller method from javascript and returns the json object. Once the json object is returned, I would like to update a table below the search field which will show the results from the json object. Basically I'm trying to list all the objects but want to filter out the results based on some search on a form.
Following is the example code that I use to get json object:
$.ajax({
type: "GET",
dataType: "json",
url: "/students/search/" + this.value,
success: function(data){
// logic to update field
});
});
UPDATE:
JSON object:
[{"student":{"student_type":"D", "student_name":"Blah Blah"}}]
I have a table in my html:
<table id="studentTable">
</table>
I would like to add student_type and student_name into a table