YII的JS处理
2015-02-27 00:00
141 查看
1.$this->registerJsFile('@web/other/jquery.autocomplete.min.js',['depends'=>['yii\web\JqueryAsset'],'position'=>yii\web\View::POS_HEAD])
2.$this->registerCssFile('@web/other/jquery.autocomplete.css');
3.$this->registerJs($jsstring)
4.$this->registerCss($cssstring)
此外在在view里临时写些代码段的话这样子
<?php $this->beginBlock('myjs') ?>
$("trainclassselect-year").click(function(){
$(this).hide();
});
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['myjs'], \yii\web\View::POS_LOAD); ?>
2.$this->registerCssFile('@web/other/jquery.autocomplete.css');
3.$this->registerJs($jsstring)
4.$this->registerCss($cssstring)
此外在在view里临时写些代码段的话这样子
<?php $this->beginBlock('myjs') ?>
$("trainclassselect-year").click(function(){
$(this).hide();
});
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['myjs'], \yii\web\View::POS_LOAD); ?>
相关文章推荐
- 页面中的图片超过规定的大小就按原图片大小缩小,不超过的就按原样的JS处理方案 选择自 WeekZero 的 Blog
- 得到 words.js?hello,world! 参数的处理方法
- 学习altas笔记[客户端JS和Altas环境初始化关系和DataTable返回数据的客户端处理]
- 利用Js和计划任务定时处理
- 利用HttpHandler处理自定义控件中需要引用大量js文件问题
- JS设置COOKIE,PHP中处理
- 学习altas笔记[客户端JS和Altas环境初始化关系和DataTable返回数据的客户端处理]
- 控件类实现了对分页变量的处理,js实现分页的显示
- 页面中的图片超过规定的大小就按原图片大小缩小,不超过的就按原样的JS处理方案
- [JS]“正在处理...”和“进度条”
- 共享一个JS分页处理的类(3)
- 一个通用的键盘快捷键处理JS
- 学习altas笔记[客户端JS和Altas环境初始化关系和DataTable返回数据的客户端处理]
- 共享一个JS分页处理类(4)
- 蛙蛙推荐:JS里声明事件处理的几种方式
- 页面中的图片超过规定的大小就按原图片大小缩小,不超过的就按原样的JS处理方案
- 共享一个JS分页处理的类(2)
- 学习Altas 笔记[js调用重载的方法出错,如何处理]
- 利用HttpHandler处理自定义控件中需要引用大量js文件问题
- JS处理文件操作