gpt4 book ai didi

javascript - 未捕获的类型错误 : Cannot read property 'message' of undefined

转载 作者:行者123 更新时间:2023-11-28 01:46:35 25 4
gpt4 key购买 nike

我正在尝试为我的网站实现一个 AJAX 联系表单,我遇到的问题是当我点击提交时我在 Google Chrome 中收到以下错误:

"Uncaught TypeError: Cannot read property 'message' of undefined----contact-form.js:38".

请查找the HTML codecontact-from.js .

最佳答案

错误是因为 responseJSON 不是 standard property或一个 that jQuery makes available用于 XMLHttpRequest

你会想 use responseText instead ,这may be parsable :

contactForm.addAjaxMessage($.parseJSON(response.responseText).message, true);

// or
contactForm.addAjaxMessage(response.responseText, true);

关于javascript - 未捕获的类型错误 : Cannot read property 'message' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22311114/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com