Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 插件仅在登录时工作(TypeError不能使用';in';运算符搜索';长度';in)_Javascript_Json_Wordpress - Fatal编程技术网

Javascript 插件仅在登录时工作(TypeError不能使用';in';运算符搜索';长度';in)

Javascript 插件仅在登录时工作(TypeError不能使用';in';运算符搜索';长度';in),javascript,json,wordpress,Javascript,Json,Wordpress,我的网站上有一个插件——事件调度器,我不知道为什么,但它在手机和一些笔记本电脑上不起作用。在我的电脑上一切正常 错误为-TypeError无法使用“in”运算符在中搜索“length”,您不允许这样做 at Object.success(escScheduler.js 270) 导入事件时(escScheduler.js 260) 以下是指向错误文件的链接- 也许有人能帮忙 UPD:这是网站 UPD2:我刚刚注意到,只有当我从错误消息中登录时,插件才起作用,似乎请求失败可能是因为一个无效的安全令

我的网站上有一个插件——事件调度器,我不知道为什么,但它在手机和一些笔记本电脑上不起作用。在我的电脑上一切正常

错误为-TypeError无法使用“in”运算符在中搜索“length”,您不允许这样做

at Object.success(escScheduler.js 270)

导入事件时(escScheduler.js 260)

以下是指向错误文件的链接- 也许有人能帮忙

UPD:这是网站


UPD2:我刚刚注意到,只有当我从错误消息中登录时,插件才起作用,似乎请求失败可能是因为一个无效的安全令牌(注意
您不允许这样做
字符串?)。然而,如果没有看到该网站,也没有关于它的更多细节(例如,你是否安装了缓存插件?@cabrerahector抱歉),就很难判断到底发生了什么。我更新了帖子。添加了网站链接,没有缓存,雪人可以在我的笔记本电脑上看到JS错误。请尝试禁用所有插件(事件计划程序除外),并查看问题是否仍然存在。如果您想知道为什么会看到此错误消息,我冒昧地在插件的Github repo上打开了一个问题:。奇怪的是,在我打开问题几分钟后,repo的所有者删除了大部分插件文件,所以…@cabrerahector只是试图禁用所有插件-没有结果
  $.ajax({
        url: esc_token.ajaxurl,
        type: "POST",
        async: false,
        data: {
            action: "getevents",
            security: esc_token.security,
            eventGroup: jsonFile
        },
        success: function (jsonEvents) {
            $.each(jsonEvents.data, function(i, item) {
                $.each(dates, function(j, item2) {
                    if (dates[j] == jsonEvents.data[i]['date']) {
                        if ((jsonEvents.data[i]['time'] !== null || jsonEvents.data[i]['time'].length > 0) && (jsonEvents.data[i]['title'] !== null || jsonEvents.data[i]['title'].length > 0)) {
                            events.push(jsonEvents.data[i]);
                        }
                    }
                });
            });

            var eventObject = new Object();
            eventObject.id = schedulerId;
            eventObject.events = events;
            escImportedEvents.push(eventObject);
        }
    });