Answer the question
In order to leave comments, you need to log in
How to include js only when the popup is active?
Good evening.
There was a small problem with loading js on the page. I have a popup that connects to the page like this (I know it's a dumb approach, but it happened):
<?=$this->renderAjax('modals/apply-popup',[
'usersCollection' => $usersCollection,
'employeeType' => $employeeType
])?>
Answer the question
In order to leave comments, you need to log in
So execute the code only on the modal opening event. It doesn't matter how you render it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question