[eluser]Unknown[/eluser]
You should send your ajax request with POST as suggested by ivantcholakov.
If you consider using POST this method, you need to protect your controller with :
Code:
if ($this->input->is_ajax_request())
{
// code
}
else
{
die("No direct access allowed, go eat some bacon");
}
Secondly, if you are using the csrf protection of CodeIgniter, you need to add your CSRF Token to your post data.
In config/config.php you have section about it.
Just send your token name and your key with your post data.
Code:
function loadVisaStatusFn()
{
var cs_vx_no = $('#cs_vx_no').val();
var cs_passport = $('#cs_passport').val();
var tcs_fname = $('#tcs_fname').val();
var tcs_passport = $('#tcs_passport').val();
$.ajax({
type: "POST",
url: '<?php echo site_url('ajax/getVisaStatus'); ?>',
data: {
cs_vx_no : cs_vx_no,
cs_passport : cs_passport,
tcs_fname : tcs_fname,
tcs_passport : tcs_passport,
csrf_token_name: "<?= $this->security->get_csrf_hash(); ?>" /* in the future of codeigniter it'll be unecessary with uri exclusions */
},
success: function(r){
handleErrorFn(r);
$("#rp-holder").html(r);
}
});
}