Unusual reaction with pjax (Content is duplciating)

Author: marsalansCreated Nov 9, 2021Updated Nov 15, 2021

gdf8g4df8g8dfg

fdg4df8g4df8g4d

My content is duplicating when i use pjax, when i visit a page, go back then come again to same page then i notice select2 dropdown and datatable button and paginations are duplicating.

f4g8df48g4d8fgd This is page when i first view it and on top when i go back and come again.

Loading function is working fine and page is loading in container.

i use $(document).pjax('.psa', '#contentArea');

.psa is what i give class name to anchor.

previously i use custom ajax method to laod pages it works but sometimes css and js files do not load then i try pjax then i found this issue. I dont know if they are reinitializing or what, but as pjax documentation says it do not reinitialize modules.

My jquery version is 2.2.4