I am trying to call another php file's function using ajax. Here is the Ajax Call :
function getBaseURL() {
var pathArray = location.href.split( '/' );
var protocol = pathArray[0];
var host = pathArray[2];
var url = protocol + '//' + host;
return url+"/PhpProject2";
}
function getPageSaverUrl() {
return getBaseURL()+"/manager/content_manager/page_saver.php/SaveTest";
}
function savePage() {
alert("Saving Page");
var url = getPageSaverUrl();
$.ajax({
type: "POST",
url: url,
data: "name=hello",
success: function(response){
alert(response);
}
});
}
But i am not getting any response from the script. Can we call php funciton from ajax url parameter?