View Full Version : Need a bit of help with AJAX-loaded content & javascript

07-21-2012, 05:32 AM
Hi there,

Hoping somebody here can at least point me toward a solution on this. Feel like I've tried everything and haven't been able to crack it - though it seems to me like it would be a very simple issue for anybody who actually knows what they're doing with javascript/AJAX.

I'm working on a very simple web page: http://andrewpop.com/2012/ - the side menu loads external .php files containing each categories content into the 'content' div.

I have this working just fine, but I'm trying to implement this plugin: http://www.appelsiini.net/projects/lazyload onto the images inside each content page so that they don't all load at once (and look much nicer fading in). As soon as I got the AJAX loading working, the javascript stopped working within the loaded page. I've tried using "loadobjs()" to no avail, and I'm certainly not well versed enough in javascript to figure this out. The first link under 'PRINT' still has all of the plugin code set up.

Any takers? As an aside, I'd also really like to be able to mask the javascript:ajaxpage links from appearing in the status bar of a visitor's browser - though none of the methods I've found thus far seem to be doing the trick.

Any help would be much appreciated!

07-21-2012, 05:12 PM
If what you want is to run JS script that is in content loaded via Ajax, see this tutorial: Execute JavaScript scripts loaded via AJAX (http://www.coursesweb.net/ajax/execute-javascript-code-ajax-response_t) .
Maybe there is also a technique with jQuery, look on the net for: " jquery executing javascript script loaded ajax " .