jQuery(...)。activeform不是Yii中的函数 [英] jQuery(...).activeform is not a function in Yii
问题描述
我正在与Yii开发一个项目。
I am developing a project with Yii.
我需要在网站的许多页面上使用jquery ui。因此,我在网站的布局中添加了jquery核心库和jQuery ui库,以便可以在所有页面上访问它们。
I need to use jquery ui on many pages of site. So I add jquery core library and jquery ui library in the layout of site to have access to them on all the pages.
但这会在具有表格(活动表格)。我在萤火虫上看到此错误:
But it causes problem on the pages which have a form (active form). I see this error on the firebug :
jQuery(...).activeform is not a function
为什么会这样?我该如何解决?
why is it so? How can I resolve it?
谢谢。
推荐答案
如果如果您在布局文件中手动包含jQuery核心库,则可能会再次加载jQuery并覆盖附加了Yii插件的原始jQuery对象。
If you include jQuery core libraries manually in your layout file, it could be possible that jQuery gets loaded a second time and overrides the original jQuery object which had the Yii plugins attached.
您应使用 Yii :: app()-> clientScript-> registerCoreScript('jquery.ui')
代替。
这篇关于jQuery(...)。activeform不是Yii中的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!