M
M
Maxim Grechushnikov2015-04-24 02:37:54
JavaScript
Maxim Grechushnikov, 2015-04-24 02:37:54

Yii2, Pjax. How to make JS scripts work after Pjax has completed?

tried like this

<?php
  //$js = '$(function(){alert(123);})';
  //$this->registerJs($js, $this::POS_END);

  $this->registerJsFile('/static/js/dynamic.js', ['depends' => [\app\assets\AppAsset::className()]]);?>
<?php \yii\widgets\Pjax::end(); ?>

Everything is connected to my appasset. result - does not work.
but what is commented out works. How to make it work?
ps I understand why it doesn't work. I don't understand how to make it work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Grechushnikov, 2015-04-24
@maxyc_webber

wrong handlers set
solution
jsfiddle.net/x9r3zojt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question