• TexassCletus

    (@texasscletus)


    Hi,

    thank you guys for the great plug-in.
    Unfortunately its not working 100% correct.

    On the megaling theme the AJAX driven Thumbnail window of the blog posts is not working and the GRAND Flash Gallery won’t work at all with it.

    I hope you guys can fix it. I really would love to have my pages open without reloading the whole website.

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Heya TexassCLetus,

    I found some code that helped me created a working solution – note that this requires hacking the plugin. I will submit this to the author to hopefully include in an update.

    I was having a similar problem in that Javascript loaded by AJAX does not parse, thus rendering it useless. I ran into the problem with the Vipers Video plugin not loading properly in pages loaded by AJAX. Your problem should also be fixed by this solution.

    I had to modify the javascript of AJAX Page Loader 1.5 file “ajax-page-loader.js”, by replacing line 89:

    document.getElementById('content').innerHTML=output;

    with

    document.getElementById('content').innerHTML=parseScript(output);
    
    		// Loop through every script collected and eval it
    		for(var i=0; i<window.scripts.length; i++) {
    			try {
    				eval(window.scripts[i]);
    			}
    			catch(ex) {
    				// do what you want here when a script fails
    			}
    		}

    and then adding the following function at the end:

    function parseScript(_source) {
    		var source = _source;
    		var window.scripts = new Array();
    
    		// Strip out tags
    		while(source.indexOf("<script") > -1 || source.indexOf("</script") > -1) {
    			var s = source.indexOf("<script");
    			var s_e = source.indexOf(">", s);
    			var e = source.indexOf("</script", s);
    			var e_e = source.indexOf(">", e);
    
    			// Add to scripts array
    			window.scripts.push(source.substring(s_e+1, e));
    			// Strip from source
    			source = source.substring(0, s) + source.substring(e_e+1);
    		}
    
    		// Return the cleaned source
    		return source;
    	}

    I found the code for this solution here:

    https://webdevelopers.net/forum/showpost.php?s=fdc4c7062a95de8c234f4294c888a2ff&p=917682&postcount=12

    Ooops, one error…please note that in the second code block it should read:

    window.scripts = new Array();

    instead of:

    var window.scripts = new Array();

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: AJAX Page Loader 1.5] Broken with JS (Shadowbox) and Flash content’ is closed to new replies.