jQuery(...)。yiiGridView不是一个函数 [英] jQuery(...).yiiGridView is not a function

查看:104
本文介绍了jQuery(...)。yiiGridView不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到Yii网格视图的问题。由于某种原因它似乎没有正确加载,即使包含脚本(我可以在源代码中看到它)。
这是HTML的标题部分:

I have a problem with Yii grid view. for some reason it does not seem to load correctly, even though the script is included (i can see it in the source code). This is the header part of the HTML:

<script src="fileadmin/static/js/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="/module/public/assets/80c0553/gridview/jquery.yiigridview.js" type="text/javascript"></script>
<script type="text/javascript">jQuery(function($) {
 jQuery('#grid-downloads').yiiGridView({'ajaxUpdate':['grid-downloads'],'ajaxVar':'ajax','pagerClass':'pager','loadingClass':'grid-view-loading','filterClass':'filters','tableClass':'def-table','selectableRows':1,'enableHistory':false,'updateSelector':'{page}, {sort}','filterSelector':'{filter}','pageVar':'page'}); 
 });
</script>

我收到错误: TypeError:jQuery(...)。yiiGridView不是函数

问题可能存在的任何想法?

Any ideas where the problem may lie?

推荐答案

我发现了这个问题。

实际问题是,不知怎的,我在页面中有两次jquery包含 - 第二次在页脚,这就是我之前找不到的原因。

Actually the problem was, somehow i got jquery included 2 times in the page - the 2nd time in the footer, that is why I did't find our earlier.

Jquery在页面中只需要一次,它需要在标题中。

Jquery needs to be only 1 time in the page, and it needs to be in the header.

这篇关于jQuery(...)。yiiGridView不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆