thanks for the answer guys, this callback method helped me a lot. It gave a 404 method, so I changed the URL. Now it works like a charm. Let me share with you all that I have done:
$('#org_name').bind('change',function(){
$("#showorg").html("wait...");
$.ajax({
url: 'http://localhost/ifes/index.php/contact/getorg',
type: 'POST',
dataType: 'html',
data:{'query':$('#org_name').val()},
timeout: 1000,
error: function(xhr,err){
alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status);
alert("responseText: "+xhr.responseText);
},
success: function(data){
$('#showorg').html(data);
}
});
});
source
share