gpt4 book ai didi

php - 未捕获的类型错误 : Cannot read property 'replace' of null

转载 作者:行者123 更新时间:2023-12-01 04:45:58 26 4
gpt4 key购买 nike

某些用户 ID 未加载 Jquery 数据表。它在 Chrome 中显示此错误

Uncaught TypeError: Cannot read property 'replace' of null

在 Firebug 中

TypeError: a is null return a.replace( /<.*?>/g, "" ).toLowerCase();

这是jquery插件问题还是我的php代码(laravel)代码..我已经调试了一天..没有找到原因。如果有人知道请告诉我是什么触发了这个错误?

最佳答案

这是因为 a 不是您所期望的,它是 null。更新代码:

if (a) return a.replace( /<.*?>/g, "" ).toLowerCase();

如果代码位于第三方库中,那么您就错过了一些东西。

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

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