ajax formdata : Illegal invocation

前端 未结 2 524
深忆病人
深忆病人 2021-01-30 12:39

I try to make ajax script for upload for Symfony 2. Chrome returns this error:

Uncaught TypeError: Illegal invocation jquery.min.js:4

相关标签:
2条回答
  • 2021-01-30 12:57

    jQuery tries to transform your FormData object to a string, add this to your $.ajax call:

    processData: false,
    contentType: false
    
    0 讨论(0)
  • 2021-01-30 12:58

    it occurs sometime when jquery internally not serialize data correctly data to fix it add this.

    cache : false,
    dataType    : 'json',
    processData : false,
    
    0 讨论(0)
提交回复
热议问题