$cs=Yii::app()->clientScript;
//加载CSS文件
$cs->registerCssFile($cssFile);
//加载JS文件
$cs->registerScriptFile($jsFile);
//直接插入JS的方法:
$cs->registerScript(
'my-hello-world-1',
'var greetings = "Hello" + " " + "World";
alert(greetings);',
CClientScript::POS_END
);
//加载CSS文件
$cs->registerCssFile($cssFile);
//加载JS文件
$cs->registerScriptFile($jsFile);
//直接插入JS的方法:
$cs->registerScript(
'my-hello-world-1',
'var greetings = "Hello" + " " + "World";
alert(greetings);',
CClientScript::POS_END
);