简体   繁体   English

Chrome控制台中的Javascript错误

[英]Javascript error in the chrome console

I recently used the famous isotope plugin in my theme. 我最近在主题中使用了著名的同位素插件。 It all works fine on the page in which it is used, but in the other appears a problem with the console (I use chrome). 一切在使用它的页面上都可以正常工作,但在另一个控制台上似乎有问题(我使用chrome)。

Uncaught TypeError: Object [object Object] has no method 'isotope' 未捕获的TypeError:对象[object Object]没有方法'isotope'

This is because all the pages are attached to the file custom.js where there is the call to the function isotope. 这是因为所有页面都附加到文件custom.js上,在此文件中调用了功能同位素。 Can I solve this problem without having to edit the file custom.js eliminating the reference to the function and having to put it on every page in which it is used directly in the 'html? 我可以解决此问题而不必编辑文件custom.js消除对函数的引用,而不必将其放在直接在'html中使用的每个页面上吗?

Thanks a lot in advance to all 在此先感谢所有人

绝对要确保将脚本拖到页面中,一种检查方法是使用Chrome调试器中的“源”标签并搜索文件。

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

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