javascript - Failed to load response data when a specific function is called -


i have file called api.php, inside of have lot of public function. i'm trying achieve call, file, specific function of api.php. perform request, this:

var posturl = globalvariables.baseurl + 'application/controllers/api.php/ajax_change_language'; var postdata = { 'language': $(this).attr('data-language') };  $.post(posturl, postdata, function(response) {    //some stuff... }, 'json'); 

how can see posturl want call ajax_change_language, have inserted after file call in url. request performed function isn't executed, tried put echo or var_dump of $_post function isn't called. did wrong?

please try :

$.post( posturl, postdata).done(function( response) {     alert( "data loaded: " + response); }); 

for information $.post please visit :$.post


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -