Hello!
Is there any way to remove js script from renderAjax, which is already loaded?
First of all I mean this:
<script src="/assets/.../jquery.js"></script>
<script src="/assets/.../yii.js"></script>
In Yii1 i could play with Yii::app()->clientScript->scriptMap['jquery.js'] = false;
But what about right way with bundles? Maybe there is an option to avoid this globally in the app?
You should use foro for this questions.
Try :
'components' => [
'assetManager' => [
'bundles' => [
'yiiwebJqueryAsset' => false,
],
],
],
See https://github.com/yiisoft/yii2/blob/master/docs/guide/structure-assets.md for more details.
Ok, thanks. I did like this in specific ajax-view
Yii::$app->assetManager->bundles['yii\web\JqueryAsset'] = false;
Yii::$app->assetManager->bundles['yii\web\YiiAsset'] = false;
And it works now
The js files aren't loaded twice (or more).
Most helpful comment
Ok, thanks. I did like this in specific ajax-view
And it works now