简体   繁体   English

如何修复我的ReferenceError

[英]How to fix my ReferenceError

I've got a WordPress website I've been working on for a project of mine, the website is not nearly finished, On the website I have a button "Create A Clan" Which uses Visual composer (A plugin) I've reached out to WP Support with no aid, When I click on the "Create A Clan" Button, The visual composer just loads, and loads. 我有一个WordPress网站,我一直在为我的项目工作,网站还没有完成,在网站上我有一个按钮“创建一个家族”使用Visual composer(一个插件)我已达到在没有帮助的情况下支持WP支持,当我点击“创建一个家族”按钮时,视觉作曲家只需加载并加载。 I hit "F12" To try to see what is going on, and I have this error in the panel. 我点击“F12”试图看看发生了什么,我在面板中有这个错误。

"Uncaught TypeError: undefined is not a function this.activities_list[i].call(window); “未捕获的TypeError:undefined不是函数this.activities_list [i] .call(window);

Uncaught ReferenceError: i is not defined(anonymous function) @ VM922:1InjectedScript._evaluateOn @ VM921:883InjectedScript._evaluateAndWrap @ VM921:816InjectedScript.evaluate @ VM921:682. 未捕获的ReferenceError:我未定义(匿名函数)@ VM922:1InjectedScript._evaluateOn @ VM921:883InjectedScript._evaluateAndWrap @ VM921:816InjectedScript.evaluate @ VM921:682。

I have no idea what the above means. 我不知道上面是什么意思。 It tells me that the error is inside of my "vc_Page_Editable.js" folder, within my theme. 它告诉我错误是在我的主题中的“vc_Page_Editable.js”文件夹中。 On line 292. 在292行。

   window.vc_google_fonts();
this.collectScriptsData();
this.loadInlineScripts();
this.loadInlineScriptsBody();
for(var i in this.activities_list) {
   this.activities_list[i].call(window);
}

I can add the ENTIRE files contents if needed. 如果需要,我可以添加ENTIRE文件内容。

It looks like there is an issue with the list and one of the elements or properties in the list is undefined, so I would say safest bet is to check if that's the case and skip to the next element. 看起来列表有一个问题,列表中的一个元素或属性是未定义的,所以我认为最安全的选择是检查是否是这种情况并跳到下一个元素。

for(var i in this.activities_list) {
    if(!i || !this.activities_list[i])
        continue;
   this.activities_list[i].call(window);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM