• james godwin

    (@james-godwin)


    I’m using Ajaxify WordPress plugin, which is working great, but if I include any script tags within a page linking to a file <script src=””></script> its is removing the tag and stopping other pluggins or theme javascript from working.

    I can see you’re removing all scripts here

    // Fetch the scripts
    					$scripts = $dataBody.find('#document-script');
    					if ( $scripts.length ) $scripts.detach();

    and adding again here

    // Add the scripts
    					$scripts.each(function(){
    						var $script = $(this),
    							scriptText = $script.html(),
    							scriptNode = document.createElement('script');
    							console.log(scriptText);
    						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($(this).attr('src') != null) {
    							scriptNode.setAttribute('src', ($(this).attr('src')));
    						}
    					});

    Any ideas?

  • The topic ‘Ajaxify WordPress Site(AWS) Issue’ is closed to new replies.