• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

在Laravel中未定义jQuery

jquery 来源:Sigal Zahavi 20次浏览

在windows上使用laravel 5.4。在Laravel中未定义jQuery

在scripts.blade文件中,我打电话给我为Admin LTE bootstrap模板下载的各种javascript文件。

代码:

<script> 
window.Laravel = {!! json_encode(['csrfToken' => csrf_token()]) !!}; 
</script> 
<script src="{{ mix('/js/app.js') }}"></script> 
<script src="https://use.fontawesome.com/8b42d9ab76.js"></script> 
<script src="/js/sweetalert.min.js"></script> 
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip --> 
<script> 
$.widget.bridge('uibutton', $.ui.button); 
</script> 

<!-- Morris.js charts --> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script> 
<script src="admin-theme/plugins/morris/morris.min.js"></script> 
<!-- Sparkline --> 
<script src="admin-theme/plugins/sparkline/jquery.sparkline.min.js"> </script> 
<!-- jvectormap --> 
<script src="admin-theme/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script> 
<script src="admin-theme/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script> 
<!-- jQuery Knob Chart --> 
<script src="admin-theme/plugins/knob/jquery.knob.js"></script> 
<!-- daterangepicker --> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js"></script> 
<script src="admin-theme/plugins/daterangepicker/daterangepicker.js"></script> 
<!-- datepicker --> 
<script src="admin-theme/plugins/datepicker/bootstrap-datepicker.js"></script> 
<!-- Bootstrap WYSIHTML5 --> 
<script src="admin-theme/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script> 
<!-- Slimscroll --> 
<script src="admin-theme/plugins/slimScroll/jquery.slimscroll.min.js"></script> 
<!-- FastClick --> 
<script src="admin-theme/plugins/fastclick/fastclick.js"></script> 
<!-- AdminLTE App --> 
<script src="admin-theme/dist/js/app.min.js"></script> 
<!-- AdminLTE dashboard demo (This is only for demo purposes) --> 
<script src="admin-theme/dist/js/pages/dashboard.js"></script> 
<!-- AdminLTE for demo purposes --> 
<script src="admin-theme/dist/js/demo.js"></script> 

在Firebug我得到所有这些错误: enter image description here

任何想法,这是为什么happenning?


===========解决方案如下:

您是否在script标签中包含了核心jquery.min.js。我看不到。你应该在任何js文件之前加入它。


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)