not working javascript with Pjax

JavaScript not working after Pjax.

<!DOCTYPE html>

<html lang="<?= Yii::$app->language ?>">





 ....  NavbarAsset::register($this);

 ....  container PHP




Я use jQuery.




         function () {


             console.log("Навели ");



         function () {

            console.log(" Убрали ");



Try this instead:

$('body').on('hover', '.lort', function() {



We should not attach an event handler to the element(s) inside the pjax area that is to be updated by ajax call.

Not working.

Could you give us a little more information?

Just saying “Not working” won’t help you any further.

If use Pjax, need use for loading js scripts it:

$(document).on('ready pjax:success' , function () {





Thanks You. :rolleyes:

And where and when are you loading the "$(.lort).hover" part of the script?