Skip to main content
2 of 2
edited according to question varibales
Subharanjan
  • 1.6k
  • 1
  • 17
  • 29

You can re-initialize all the scripts once again inside the AJAX success.

// Fetch the scripts
scripts = '';
if ( scripts.length ) scripts.detach();
scripts = response.find('script');

// Add the scripts
scripts.each(function(){
        var script = jQuery(this), 
            scriptText = script.html(), 
            scriptNode = document.createElement('script');
        try {
                // doesn't work on ie...
                scriptNode.appendChild(document.createTextNode(scriptText));
                contentNode.appendChild(scriptNode);
        } catch(e) {
                // IE has funky script nodes
                scriptNode.text = scriptText;
                contentNode.appendChild(scriptNode);
        }
        if(jQuery(this).attr('src') != null) {
                scriptNode.setAttribute('src', (jQuery(this).attr('src')));
        }
});
Subharanjan
  • 1.6k
  • 1
  • 17
  • 29