Getting TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode

前端 未结 2 1995
走了就别回头了
走了就别回头了 2020-12-17 09:26

I have such jQuery code:

$(document).ready(function() {

  $(\'.btn-create-post-card\').on(\'click\', function(event)          


        
相关标签:
2条回答
  • 2020-12-17 09:39

    I found the issue: it was in dataType: 'multipart/form-data' and, after I remove it, everything is working.

    I think it worked on a different machine because the browser version on that machine does not support strict mode.

    0 讨论(0)
  • 2020-12-17 09:47

    I don't think strict mode is the error, it's just that the console can't get the contents of the arguments array in strict mode. The status is 200 so it looks like the ajax call worked, but the response text says "can't upload file", so I think the error is on the server side.

    Update with TypeError example:

    That TypeError just says the console can't get the values the arguments array when using strict mode. It's not an error with the code. The simple example in the image demonstrates this.

    0 讨论(0)
提交回复
热议问题