A
A
Anton Natarov2016-03-24 18:44:07
JavaScript
Anton Natarov, 2016-03-24 18:44:07

Yii2 how to lower your JS script below the rest?

It turns out that the form generated by ActiveForm overrides my script.

<script>
<script src="/rexit/web/js/someScript.js">// мой скрипт
<script src="/rexit/web/assets/f93372f5/jquery.js">
<script src="/rexit/web/assets/fb4777e0/yii.js">
<script src="/rexit/web/assets/fb4777e0/yii.validation.js">
<script src="/rexit/web/assets/fb4777e0/yii.activeForm.js">
<script src="/rexit/web/assets/98fb4049/js/bootstrap.js">
<script type="text/javascript"> // тут подключается ActiveForm и перезаписывает все что применялось выше.

in views I connect like this
$this->registerJsFile('@web/js/someScript.js', ['position' => $this::POS_END], 'myScript');

However, it is not entirely clear how it works. Pure Alerts work. as soon as I start doing things like
$('#container').hide();
Doesn't perceive. it seems that Js from bootstrap is connected and even if I connect separately, it doesn't work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Gogolinsky, 2016-03-24
@HanDroid

www.yiiframework.com/doc-2.0/yii-web-view.html#reg...
depends

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question