When I push a green button on http://jazzkredit.ru/ after submission form, I get message "ajaxUrl is not defined" instead of image that should pop up and email that I should receive on email.
Can anybody help me to solve this issue? I have tried to search for an answer on Google and in Stackoverflow but it didn't help.
var formData = new FormData($('form#loanappform')[0]);
$.ajax({
url: ajaxUrl, //Server script to process data
type: 'POST',
xhr: function() { // Custom XMLHttpRequest
var myXhr = $.ajaxSettings.xhr();
if(myXhr.upload){ // Check if upload property exists
myXhr.upload.addEventListener('progress',progressHandlingFunction, false); // For handling the progress of the upload
}
return myXhr;
},
//Ajax events
success: completeHandler,
// Form data
data: formData,
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: false
});
You need to define ajaxUrl first or just use the direct name of the server-side file to which you are posting: Method A: var ajaxUrl = "process-ajax.php"
Method B: url: "process-ajax.php"