$(document).on('click','#edit',function(){
var id = $(this).attr('value');
$.ajax({
type:'post',
url:"http://localhost/CI-Ajaxold/register/show/"+id,
}).done(function(data){
console.log(data);
});
});
RESPONSE IN CONSOLE => [{"id":"23","name":"fhfhfh",}]
2
Answers
You need to parse the
JSON
response as below:Then you can use it by iterating loop or anything else as per your need.
Thanks and hopefully it helps you!
try this code: