doubi4814 2012-07-21 15:55
浏览 225
已采纳

如何使用ajax返回成功/失败消息?

I'm using MailChimp's API and I can successfully subscribe an email address by passing an email address to a specific URL. Once the email is submitted, MailChimp echoes a success or failure code.

Example: myurl.com/subscribe.php?email=example@gmail.com

What I need help with

My form isn't displaying the success/failure messages that I've based on MailChimps returned codes. What am I doing wrong?

http://jsfiddle.net/WarrenBee/c4MWX/

  • 写回答

2条回答 默认 最新

  • doushang9172 2012-07-21 16:09
    关注

    As long as I'm guessing on comments, I'll guess on an answer. I went to http://yoursite.com/subscribe/mcapi_listSubscribe.php?email=joe@joe.com in my browser. I got this:

    Unable to load listSubscribe()! Code=220 Msg="joe@joe.com" has been banned

    So, you've got a problem in your server-side code. It can't load a function named listSubscribe(). Also, regardless, you're not returning stuff in JSON format, but your ajax call is expecting such.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?