关于YII2框架-jQuery(…).activeform is not a function in 解决方法
在使用YII2框架过程中遇到过控制台报出一个JS错误,jQuery(…).activeform is not a function,查看源代码看到这里。
确定一下yii框架这个文件有没有加载
yii.activeForm.js
没有的话,那么问题原因就找到了。
解决方案有很多种。
而我这里采用的是
\assets\AppAsset.php 里面,也就是你注册的静态资源配置里面
加上一个
然后保存,清掉缓存,再试试看。
当然你也可以选择
或者直接模版里面加载js。都能解决。