JQuery: 'Uncaught TypeError: Illegal invocation' at ajax request - several elements

后端 未结 8 1201
醉话见心
醉话见心 2020-11-27 03:38

I have two select elements, A and B: when A\'s selected option changes, B\'s options must be updated accordingly. Each element in A implies many elements in B, it\'s a one-t

8条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 03:51

    From the jQuery docs for processData:

    processData Boolean
    Default: true
    By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false.

    Source: http://api.jquery.com/jquery.ajax

    Looks like you are going to have to use processData to send your data to the server, or modify your php script to support querystring encoded parameters.

提交回复
热议问题