After trying some solutions from this and many other questions I wasn't able to get what is exact problem in my code. My code
$(document).ready(function() {
$("#botname").blur(function() {
$.ajax({
type: "POST",
url: "/tukaiexotic/rq/requisition/typhead",
contentType: "application/json; charset=utf-8",
success: function(result) {
$("#commmonname").val(result);
}
});
});
});
It returns my expected result, but with result, it returns the HTML code of the whole page.
What is wrong in code?
Server side script
function typhead_mod()
{
$this->db->select("fa_id,fa_code,fa_name");
$aaa=$this->db->get('tukai_farms')->result();
echo strip_tags($aaa);
}