相关疑难解决方法(0)

获取TypeError:在严格模式下可能无法访问“ caller”,“ callee”和“ arguments”属性

我有这样的jQuery代码:

$(document).ready(function() {

  $('.btn-create-post-card').on('click', function(event) {
    event.preventDefault();
    let form_data = new FormData(),
      file = $('.input_file_button');
    // if(!file.val()) {
    //     alert('Please select postcard you want to send')
    // }
    form_data.append("file", file.prop('files')[0]);
    $.ajax({
      url: "/sendEmail",
      dataType: 'multipart/form-data',
      cache: false,
      contentType: false,
      processData: false,
      data: form_data,
      type: 'post',
      success: function(data) {
        alert('OK');
      },
      error: function(error, status) {
        console.log('here');
        console.log(error);
        alert(error);
      }
    });
  });
});
Run Code Online (Sandbox Code Playgroud)

而且我得到了错误:

TypeError:在严格模式函数或
    在Function.remoteFunction(:2:14)上调用它们的参数对象上,可能无法访问“ caller”,“ callee”和“ arguments”属性

控制台输出为: 在此处输入图片说明

如您所见,响应是成功的,并且我之前使用jQuery AJAX调用很多次,并且从未遇到过此类问题。

更新:

控制台输出:

abort: ƒ (e)
    arguments: [Exception: TypeError: 'caller', 'callee', …
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

ajax ×1

javascript ×1

jquery ×1