Register Script Using Defer And Async In Yii

Hi All,

I want to register my core script "jquery" using defer or async.

Is there any way to do that in yii as I am using




<?php Yii::app()->clientScript->registerCoreScript('jquery');?>



If I have to do that manually what is the way?

Also if I publish one js file as asset then also what to do?

I am not getting those answers, Please help me.

Thanks,

Maclein

Do you find an issue for that please ?

I have the same problème.

This does not work

Yii::app()->clientScript->registerScriptFile($baseUrl.’/js/structure.js’,CClientScript::POS_END,$htmlOptions=array(‘id’=>‘async’));

Thank you

Надо так


Yii::app()->clientScript->registerScriptFile($baseUrl.'/js/structure.js',CClientScript::POS_END,array('id'=>'async'));

1 Like