Dle-Billing DataLife 引擎

Dle-Billing DataLife Engine

提问人:Alexandru Gorgan 提问时间:11/17/2023 最后编辑:Alexandru Gorgan 更新时间:11/17/2023 访问量:11

问:

及时在网站上调用ajax函数时,我收到下一个问题:

Uncaught TypeError: Cannot read properties of undefined (reading 'split')
    at BillingNews.Declension (fixednews.js:97:23)
    at BillingNews.Days (fixednews.js:65:90)
    at Object.success (fixednews.js:39:16)
    at i (index.php?g=general&v=1bz3s:2:27151)
    at Object.fireWith [as resolveWith] (index.php?g=general&v=1bz3s:2:27914)
    at z (index.php?g=general&v=1bz3s:4:12059)
    at XMLHttpRequest.<anonymous> (index.php?g=general&v=1bz3s:4:15619)

这个“split”有下一个功能:

this.Declension = function( number, currency )
    {
        currency = currency.split(',');
        cases = [2, 0, 1, 1, 1, 2];

        return ' ' + currency[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
    }

我使用 PHP 8.1,在 PHP 7.4 中一切正常。

我进行下一次拆分更改:

if (currency !== null && currency !== undefined && currency !== "") {
    currency = currency.split(',');
} else {
    console.error("currency is null or empty");
}

但不起作用

Javascript PHP

评论


答: 暂无答案