Yii2的View中JS代码添加
时间:2015-08-27 09:33:36
收藏:0
阅读:2651
直接写
<script>
$(function(){
alert("aaa");
});
<script>
会提示出错,写成
<?php
$js = <<<JS
$(function(){
alert("aaa");
});
JS;
$this->registerJs($js);
?>
可正确执行
评论(0)