Answer the question
In order to leave comments, you need to log in
How to make the js file load not after jq, but after a certain file of its own?
I have a separate js file on one page. I connect it like this.
<? $this->registerJsFile('@web/user/js/jquery.formstyler.js', ['depends' => [yii\web\JqueryAsset::className()]]); ?>
Answer the question
In order to leave comments, you need to log in
is it possible to somehow prescribe it so that it becomes dependent on another js file, for example main.js?
It is highly recommended to use asset bundles to register external JS files rather than registerJsFile() because these allow better flexibility and more granular dependency configuration. Also using asset bundles allows you to combine and compress multiple JS files, which is desirable for high traffic websites.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question