ajaxUrl is not defined

ajaxUrl is not defined

本文关键字:defined not is ajaxUrl      更新时间:2023-09-26

当我按下绿色按钮时http://jazzkredit.ru/在提交表单后,我收到了消息"ajaxUrl未定义",而不是应该弹出的图像和我应该在电子邮件中收到的电子邮件。

有人能帮我解决这个问题吗?我试着在谷歌和Stackoverflow上搜索答案,但没有帮助。

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
});

您需要首先定义ajaxUrl,或者只使用发布到的服务器端文件的直接名称:方法A:var ajaxUrl = "process-ajax.php"方法B:url: "process-ajax.php"