【问题标题】:jQuery.Deferred exception: Unexpected token < in JSON at position 0 SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) [duplicate]jQuery.Deferred 异常:JSON.parse (<anonymous>) 位置 0 处 JSON 中的意外令牌 < 语法错误:JSON.parse (<anonymous>)
【发布时间】:2022-01-26 11:51:39
【问题描述】:

我突然收到此错误。一切正常,但突然开始出现,因此我的 Stripe Payment Form 根本没有出现。

错误

jQuery.Deferred exception: Unexpected token < in JSON at position 0 SyntaxError: Unexpected token < in JSON at position 0  at JSON.parse (<anonymous>)

也从控制台附加图像

enter image description here

enter image description here

【问题讨论】:

  • 那个错误意味着它不是 JSON,很可能有额外的 HTML。如果您查看未处理的结果,应该很明显。
  • 你试过search吗?
  • 搜索?抱歉没能找到你。但是我试过了,我的 Stripe 付款表格还没有显示出来。
  • 在 SO 页面的顶部是一个搜索框 - 在那里复制您的错误或单击我提供的链接。

标签: php jquery stripe-payments


【解决方案1】:

这不是 JSON 或 HTML 错误。 这是 Stripe 通信的问题。我的意思是,TLS 1.2 版需要与条带通信。 重新安装了 Stripe 最新的库,问题已解决

【讨论】:

  • 有关 TLS 问题的错误将作为 HTML 返回。问题是 100% 由于响应的 HTML 格式,当您的代码告诉 jQuery 期待 JSON 时。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-03-21
  • 2018-03-19
  • 2020-04-12
  • 2021-09-20
相关资源
最近更新 更多