Answer the question
In order to leave comments, you need to log in
Why doesn't the script file fire a second time in the modal window?
Page is loaded via renderAjax()
return [
'content'=>$this->renderAjax('update', [
'model' => $model, ]),
];
$this->registerJsFile('/js/script.js',['depends' => 'yii\web\JqueryAsset']);
$script = <<<JS
alert('test')
JS;
$this->registerJs($script);
Answer the question
In order to leave comments, you need to log in
try writing all js in files, then if you use jquery then for each processing do this: $(document).on("click", "selector", function(){});
The fact is that when you load something via ajax, it will work exactly once, i.e. after updating the data, jqury stops seeing what is drawn again. the code above helps solve this problem
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question