I have decided to use PJAX namely Barba js
plugin .
It works great but i have a problem and really need to reinitialize a bunch of js plugins on PJAX ready .
I have tried the following code basically it is from Barba js 1.0 where i use the dispatcher and specify on NewPage Ready create a new script element and append it to the head of the document .
But it doesn't reinitialize or reload the jquery plugin.
am i missing something or is this not the correct way to reinitialize my files ?
Barba.Dispatcher.on('newPageReady', function (currentStatus,
oldStatus, container) {
alert("the alert works ");
var importeda = document.createElement('script');
importeda.src ='..js/jquery-1.8.3.js';
document.head.appendChild(importeda);
} );