hello,
i am developing a project that uses ajax requests, as i test this project on my local xampp server it works like a charm but if i test it on a host some of ajax requests fails.
example : the response should be 0
but it returns the whole page source code.
- I also had checked the console network logs
i have no idea about it!
this is the code :
//submit forms
$scope.formSubmit = function(id,fn){
if ($scope.myForm.$valid) {
var formInput = $('#'+id).serializeArray();
//1st lvl of adding
$http.post('inc/fc/class/formdb.php',{wf_id:id}).success(function(resp){
if(resp == ''){
$scope.workflowOptions = [];
}else{
$scope.workflowOptions = resp;
$scope.first_receiver = $scope.workflowOptions[0].user;
$.ajax({
type:'POST',
url:'inc/subfc/submitform.php',
data:{formName:fn,rec:$scope.first_receiver,formData:JSON.stringify(formInput),formId:localStorage.getItem('thisFormId'),user:sessionStorage.getItem('user')}
}).success(function(data){
if(data == 1){
$('#ajax_messages_head').html('doc confirmation');
$('#message').html('your doc has been submited. <i class="fa fa-check fa-fw" style="color:green;"></i>');
$('#ajax_messages').modal('show');
}
}).error(function(data){
$('#ajax_messages_head').html('doc confirmation');
$('#message').html('sorry something went wrong. <i class="fa fa-remove fa-fw" style="color:red;"></i>');
$('#ajax_messages').modal('show');
});
}
});
}
};