In my PHP/jQuery application, I have a javascript file, in which I can call an external PHP file (post_data.php) like this:
$.ajax({
            type: "POST",
            data: "some data",
            url: "post_data.php",
Now, instead of calling php file, i would like to call a CodeIgniter contoller function Data/post_data, so how can I call that function instead of post_data.php?
The javascript file in which i would like to call is located:
root/js/test.js
while the function is located here:
root/application/controllers/data/post_data

