jQuery Ajax POST not working with MailChimp

前端 未结 3 776
伪装坚强ぢ
伪装坚强ぢ 2021-01-02 08:59

I have the following code I am using to send data to a MailChimp Newsletter List (API v3). Everytime I remove the type: POST from the function it attempts to p

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-02 09:57

    There is an undocumented endpoint that uses JSONP to do cross-domain ajax requests.

    Just change 'post?' to 'post-json?' and add '&c=?' to the end of the standard url to get the JSONP endpoint. This doesn't requires the API key to be exposed on the client-side, or the creation of a server-side view.

    I wrote a jQuery plugin that uses this method, if that's useful at all

    https://github.com/scdoshi/jquery-ajaxchimp

提交回复
热议问题