这家伙有点懒,还没写个性签名!
<script> <?php $this->beginBlock('js_end') ?> $(document).ready(function(){ $("#demo").click(function(){ ...... }); }); <?php $this->endBlock() ?> </script> <?php $this->registerJs($this->blocks['js_end'], \yii\web\View::POS_END); ?>