You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been implementing PJAX using the yii2-pjax plugin quite successfully. I'm using it to only load the content on my page and keep the header and sidebar static, saving quite a few seconds on not having to reload the assets added to the header and the sidebar.
However, on some of my pages I'm using certain asset bundles to load in javascript only applied to those pages. When loading in the content with pjax these asset bundles are not being registered as I expected they would be. I'm wondering if there is any way to do what I want to do or if the only solution is to add a global javascript file that includes all functions? I would rather not do this as this might create quite a big file and a lot of unused code on certain pages.
This is how I've defined my content:
<?php Pjax::begin() ?>
AdminAsset::register($this);
// Content here
<?php Pjax::end() ?>
I've looked for the majority of the day and can't find a clean solution besides having one big application.js file or using inline javascript, both of which I would like to avoid.
The text was updated successfully, but these errors were encountered:
I have been implementing PJAX using the yii2-pjax plugin quite successfully. I'm using it to only load the content on my page and keep the header and sidebar static, saving quite a few seconds on not having to reload the assets added to the header and the sidebar.
However, on some of my pages I'm using certain asset bundles to load in javascript only applied to those pages. When loading in the content with pjax these asset bundles are not being registered as I expected they would be. I'm wondering if there is any way to do what I want to do or if the only solution is to add a global javascript file that includes all functions? I would rather not do this as this might create quite a big file and a lot of unused code on certain pages.
This is how I've defined my content:
I've looked for the majority of the day and can't find a clean solution besides having one big application.js file or using inline javascript, both of which I would like to avoid.
The text was updated successfully, but these errors were encountered: