gpt4 book ai didi

javascript - Rails + Javascript + 未捕获的类型错误 : Object # has no method
转载 作者:行者123 更新时间:2023-11-28 09:16:27 24 4
gpt4 key购买 nike

我正在使用购买的模板,但遇到了此问题:

Uncaught TypeError: Object #<Object> has no method 'peity' in unicorn.dashboard.js:11

这是第 11 行:

unicorn.peity();

在我的 list 文件中我得到了这个:

//= require admins/cms/excanvas.min
//= require admins/cms/jquery.min
//= require admins/cms/jquery.ui.custom
//= require admins/cms/jquery.uniform
//= require admins/cms/jquery.flot.min
//= require admins/cms/jquery.flot.resize.min
//= require admins/cms/jquery.dataTables.min
//= require admins/cms/jquery.gritter.min
//= require admins/cms/jquery.validate

//= require admins/cms/jquery.peity

//= require admins/cms/jquery.wizard
//= require admins/cms/select2.min
//= require admins/cms/fullcalendar.min
//= require admins/cms/bootstrap.min
//= require admins/cms/bootstrap-colorpicker
//= require admins/cms/bootstrap-datepicker
//= require admins/cms/unicorn

//= require admins/cms/unicorn.dashboard

//= require admins/cms/unicorn.form_common
//= require admins/cms/unicorn.form_validation
//= require admins/cms/unicorn.wizard
//= require admins/cms/unicorn.interface
//= require admins/cms/unicorn.tables
//= require admins/cms/unicorn.charts
//= require admins/cms/unicorn.calendar

这是在模板附带的静态index.html中加载脚本的方式:

<script src="js/jquery.min.js"></script>
<script src="js/jquery.ui.custom.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-colorpicker.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/jquery.uniform.js"></script>
<script src="js/select2.min.js"></script>
<script src="js/unicorn.js"></script>
<script src="js/unicorn.form_common.js"></script>

这就是我的仪表板索引脚本的加载方式:

<script src="/assets/admins/cms/excanvas.min.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/jquery.min.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/jquery.ui.custom.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/jquery.uniform.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/jquery.flot.min.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/jquery.flot.resize.min.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/jquery.dataTables.min.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/jquery.gritter.min.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/jquery.validate.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/jquery.peity.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/jquery.wizard.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/select2.min.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/fullcalendar.min.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/bootstrap.min.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/bootstrap-colorpicker.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/bootstrap-datepicker.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/unicorn.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/unicorn.dashboard.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/unicorn.form_common.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/unicorn.form_validation.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/unicorn.wizard.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/unicorn.interface.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/unicorn.tables.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/unicorn.charts.js?body=1" type="text/javascript"></script>
<script src="/assets/admins/cms/unicorn.calendar.js?body=1" type="text/javascript"></script>

奇怪的是 unicorn.dashboard 在 jquery.peity 之后加载。另一个奇怪的事情是,当我打开模板附带的index.html 时,它根本没有收到此错误。我不确定问题是什么。我花了几个小时试图解决这个问题,但我一点运气都没有。

如果有人能帮助我解决这个问题,那就太好了。提前致谢。

最佳答案

如果您(暂时)更改 list 以完全匹配index.html 文件,事情会起作用吗?

如果是这样,我怀疑 peity、unicorn 和其他包含的东西(可能是 explorecanvas)之间存在冲突。

关于javascript - Rails + Javascript + 未捕获的类型错误 : Object #<Object> has no method,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15583216/

24 4 0