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条)

报告相同问题?

悬赏问题

  • ¥15 树莓派5怎么用camera module 3啊
  • ¥20 java在应用程序里获取不到扬声器设备
  • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加