“Uncaught TypeError: Cannot use 'in' operator to search for 'length' in ” triggered by Datatables plugin and jQuery 1.11.3

后端 未结 8 1157
北恋
北恋 2021-02-12 13:17

I\'m using the jQuery Datatables plugin to enable pagination, sorting and searching with my tables. The elements are showing up but not working, and the pagination only sometime

8条回答
  •  离开以前
    2021-02-12 13:32

    I had this exact same issue but jQuery version was not the culprit for me. In my case, I was incorrectly serializing the form. The code ended up with this error was:

    $('#form_name').serialize()
    

    Whereas I should have used.

    $('#form_name').serializeArray()
    

    I did this and my issue was resolved.

    Just throwing out this little piece that I ignored. Could help someone out there.

提交回复
热议问题