yii2.0中使用jquery

来源:互联网 发布:淘宝上没有点击量 编辑:程序博客网 时间:2024/06/07 16:44

     我们都知道 yii 框架是组件式开发的,使用 jquery 也是非常简单的。只需要注册一下就可以使用非常简单的 jquery 代码了!

<?php $this->beginBlock('suibian') ?>$("#old_3").click(function(){     $.get("url",function(msg){alert(msg);});});<?php $this->endBlock() ?><?php $this->registerJs($this->blocks['suibian']); ?>

注意:suibian 是任意起的名字,可根据你的心情来命名。

0 0
原创粉丝点击